mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* insnhelper.ci, string.c: fixed indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0c031468fe
commit
c2a41b3a71
2 changed files with 39 additions and 39 deletions
|
@ -532,45 +532,45 @@ vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp,
|
||||||
node = mn->nd_body;
|
node = mn->nd_body;
|
||||||
switch (nd_type(node)) {
|
switch (nd_type(node)) {
|
||||||
case RUBY_VM_METHOD_NODE:{
|
case RUBY_VM_METHOD_NODE:{
|
||||||
vm_setup_method(th, cfp, num, blockptr, flag, (VALUE)node->nd_body, recv, klass);
|
vm_setup_method(th, cfp, num, blockptr, flag, (VALUE)node->nd_body, recv, klass);
|
||||||
return Qundef;
|
return Qundef;
|
||||||
}
|
}
|
||||||
case NODE_CFUNC:{
|
case NODE_CFUNC:{
|
||||||
val = vm_call_cfunc(th, cfp, num, id, recv, klass, node, blockptr);
|
val = vm_call_cfunc(th, cfp, num, id, recv, klass, node, blockptr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NODE_ATTRSET:{
|
case NODE_ATTRSET:{
|
||||||
val = rb_ivar_set(recv, node->nd_vid, *(cfp->sp - 1));
|
val = rb_ivar_set(recv, node->nd_vid, *(cfp->sp - 1));
|
||||||
cfp->sp -= 2;
|
cfp->sp -= 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NODE_IVAR:{
|
case NODE_IVAR:{
|
||||||
val = rb_ivar_get(recv, node->nd_vid);
|
val = rb_ivar_get(recv, node->nd_vid);
|
||||||
cfp->sp -= 1;
|
cfp->sp -= 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NODE_BMETHOD:{
|
case NODE_BMETHOD:{
|
||||||
VALUE *argv = cfp->sp - num;
|
VALUE *argv = cfp->sp - num;
|
||||||
val = vm_call_bmethod(th, id, node->nd_cval, recv, klass, num, argv);
|
val = vm_call_bmethod(th, id, node->nd_cval, recv, klass, num, argv);
|
||||||
cfp->sp += - num - 1;
|
cfp->sp += - num - 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NODE_ZSUPER:{
|
case NODE_ZSUPER:{
|
||||||
klass = RCLASS(mn->nd_clss)->super;
|
klass = RCLASS(mn->nd_clss)->super;
|
||||||
mn = rb_method_node(klass, id);
|
mn = rb_method_node(klass, id);
|
||||||
|
|
||||||
if (mn != 0) {
|
if (mn != 0) {
|
||||||
goto normal_method_dispatch;
|
goto normal_method_dispatch;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
goto start_method_dispatch;
|
goto start_method_dispatch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
default:{
|
default:{
|
||||||
printf("node: %s\n", ruby_node_name(nd_type(node)));
|
printf("node: %s\n", ruby_node_name(nd_type(node)));
|
||||||
rb_bug("eval_invoke_method: unreachable");
|
rb_bug("eval_invoke_method: unreachable");
|
||||||
/* unreachable */
|
/* unreachable */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -881,14 +881,14 @@ lfp_svar_get(rb_thread_t *th, VALUE *lfp, VALUE key)
|
||||||
case 2:
|
case 2:
|
||||||
return svar->basic.klass;
|
return svar->basic.klass;
|
||||||
default: {
|
default: {
|
||||||
VALUE hash = svar->v3;
|
VALUE hash = svar->v3;
|
||||||
|
|
||||||
if (hash == Qnil) {
|
if (hash == Qnil) {
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return rb_hash_lookup(hash, key);
|
return rb_hash_lookup(hash, key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -909,12 +909,12 @@ lfp_svar_set(rb_thread_t *th, VALUE *lfp, VALUE key, VALUE val)
|
||||||
svar->basic.klass = val;
|
svar->basic.klass = val;
|
||||||
return;
|
return;
|
||||||
default: {
|
default: {
|
||||||
VALUE hash = svar->v3;
|
VALUE hash = svar->v3;
|
||||||
|
|
||||||
if (hash == Qnil) {
|
if (hash == Qnil) {
|
||||||
svar->v3 = hash = rb_hash_new();
|
svar->v3 = hash = rb_hash_new();
|
||||||
}
|
}
|
||||||
rb_hash_aset(hash, key, val);
|
rb_hash_aset(hash, key, val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
string.c
2
string.c
|
@ -201,7 +201,7 @@ str_new3(VALUE klass, VALUE str)
|
||||||
RSTRING(str2)->as.heap.len = RSTRING_LEN(str);
|
RSTRING(str2)->as.heap.len = RSTRING_LEN(str);
|
||||||
RSTRING(str2)->as.heap.ptr = RSTRING_PTR(str);
|
RSTRING(str2)->as.heap.ptr = RSTRING_PTR(str);
|
||||||
RSTRING(str2)->as.heap.aux.shared = str;
|
RSTRING(str2)->as.heap.aux.shared = str;
|
||||||
FL_SET(str2, ELTS_SHARED);
|
FL_SET(str2, ELTS_SHARED);
|
||||||
}
|
}
|
||||||
|
|
||||||
return str2;
|
return str2;
|
||||||
|
|
Loading…
Add table
Reference in a new issue