Sha256: daa721a058c51657a136d7da8e9ebb09301d368822bd1bb7dc10626c6adef0a5

Contents?: true

Size: 603 Bytes

Versions: 1

Compression:

Stored size: 603 Bytes

Contents

#include "cruby.h"

rb_cref_t * rb_vm_get_cref(const VALUE *ep);
static inline void
vm_ensure_not_refinement_module(VALUE self)
{
  if (RB_TYPE_P(self, T_MODULE) && FL_TEST(self, RMODULE_IS_REFINEMENT)) {
    rb_warn("not defined at the refinement, but at the outer class/module");
  }
}

VALUE vm_get_cvar_base(const rb_cref_t *cref, rb_control_frame_t *cfp);
void
llrb_insn_setclassvariable(VALUE cfp_v, ID id, VALUE val)
{
  rb_control_frame_t *cfp = (rb_control_frame_t *)cfp_v;
  vm_ensure_not_refinement_module(cfp->self);
  rb_cvar_set(vm_get_cvar_base(rb_vm_get_cref(cfp->ep), cfp), id, val);
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
llrb-0.0.1 ext/llrb_insn_setclassvariable.c