diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-09-26 10:22:01 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-09-30 10:26:38 +0900 |
commit | dd883de5ba311c38818d0f638a94b4fbc63f5ee5 (patch) | |
tree | d430c06f19a7dcafdc35558f7720d48308dfd435 /vm_backtrace.c | |
parent | 6c6a25feca8752205d81c5247f85d8ae8fb880d8 (diff) | |
download | ruby-dd883de5ba311c38818d0f638a94b4fbc63f5ee5.tar.gz |
refactor constify most of rb_method_entry_t
Now that we have eliminated most destructive operations over the
rb_method_entry_t / rb_callable_method_entry_t, let's make them
mostly immutabe and mark them const.
One exception is rb_export_method(), which destructively modifies
visibilities of method entries. I have left that operation as is
because I suspect that destructiveness is the nature of that
function.
Diffstat (limited to 'vm_backtrace.c')
-rw-r--r-- | vm_backtrace.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vm_backtrace.c b/vm_backtrace.c index 44a4ac0784..3a8ad9143d 100644 --- a/vm_backtrace.c +++ b/vm_backtrace.c @@ -1349,7 +1349,7 @@ frame2iseq(VALUE frame) return (const rb_iseq_t *)frame; case imemo_ment: { - const rb_callable_method_entry_t *cme = (rb_callable_method_entry_t *)frame; + const rb_callable_method_entry_t *cme = (const rb_callable_method_entry_t *)frame; switch (cme->def->type) { case VM_METHOD_TYPE_ISEQ: return cme->def->body.iseq.iseqptr; @@ -1405,7 +1405,7 @@ frame2klass(VALUE frame) if (frame == Qnil) return Qnil; if (RB_TYPE_P(frame, T_IMEMO)) { - const rb_callable_method_entry_t *cme = (rb_callable_method_entry_t *)frame; + const rb_callable_method_entry_t *cme = (const rb_callable_method_entry_t *)frame; if (imemo_type(frame) == imemo_ment) { return cme->defined_class; |