summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-27 23:22:10 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-27 23:22:10 +0000
commit5dc9855a4f6a223b903fb6629aace9a5a49b064b (patch)
treeaef1fd818eb923ade71bee64f733ac2087959ae9 /vm_insnhelper.c
parent2731767b5dfefacf139ba4eedb25a9b550ad5454 (diff)
vm_insnhelper.c: fix indentation
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 38c767d5be..b32234cbf4 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -2057,72 +2057,72 @@ vm_yield_setup_block_args(rb_thread_t *th, const rb_iseq_t * iseq,
* => {|a, b|} => a, b = [1, 2]
*/
arg0 = argv[0];
- if (!(iseq->arg_simple & 0x02) && /* exclude {|a|} */
- (m + iseq->arg_opts + iseq->arg_post_len) > 0 && /* this process is meaningful */
- argc == 1 && !NIL_P(ary = rb_check_array_type(arg0))) { /* rhs is only an array */
- th->mark_stack_len = argc = RARRAY_LENINT(ary);
+ if (!(iseq->arg_simple & 0x02) && /* exclude {|a|} */
+ (m + iseq->arg_opts + iseq->arg_post_len) > 0 && /* this process is meaningful */
+ argc == 1 && !NIL_P(ary = rb_check_array_type(arg0))) { /* rhs is only an array */
+ th->mark_stack_len = argc = RARRAY_LENINT(ary);
- CHECK_STACK_OVERFLOW(th->cfp, argc);
+ CHECK_STACK_OVERFLOW(th->cfp, argc);
- MEMCPY(argv, RARRAY_PTR(ary), VALUE, argc);
+ MEMCPY(argv, RARRAY_PTR(ary), VALUE, argc);
}
else {
- argv[0] = arg0;
+ argv[0] = arg0;
}
for (i=argc; i<m; i++) {
- argv[i] = Qnil;
+ argv[i] = Qnil;
}
if (iseq->arg_rest == -1 && iseq->arg_opts == 0) {
- const int arg_size = iseq->arg_size;
- if (arg_size < argc) {
- /*
- * yield 1, 2
- * => {|a|} # truncate
- */
- th->mark_stack_len = argc = arg_size;
- }
+ const int arg_size = iseq->arg_size;
+ if (arg_size < argc) {
+ /*
+ * yield 1, 2
+ * => {|a|} # truncate
+ */
+ th->mark_stack_len = argc = arg_size;
+ }
}
else {
- int r = iseq->arg_rest;
+ int r = iseq->arg_rest;
- if (iseq->arg_post_len ||
- iseq->arg_opts) { /* TODO: implement simple version for (iseq->arg_post_len==0 && iseq->arg_opts > 0) */
+ if (iseq->arg_post_len ||
+ iseq->arg_opts) { /* TODO: implement simple version for (iseq->arg_post_len==0 && iseq->arg_opts > 0) */
opt_pc = vm_yield_setup_block_args_complex(th, iseq, argc, argv);
- }
- else {
- if (argc < r) {
- /* yield 1
- * => {|a, b, *r|}
- */
- for (i=argc; i<r; i++) {
- argv[i] = Qnil;
- }
- argv[r] = rb_ary_new();
- }
- else {
- argv[r] = rb_ary_new4(argc-r, &argv[r]);
- }
- }
-
- th->mark_stack_len = iseq->arg_size;
+ }
+ else {
+ if (argc < r) {
+ /* yield 1
+ * => {|a, b, *r|}
+ */
+ for (i=argc; i<r; i++) {
+ argv[i] = Qnil;
+ }
+ argv[r] = rb_ary_new();
+ }
+ else {
+ argv[r] = rb_ary_new4(argc-r, &argv[r]);
+ }
+ }
+
+ th->mark_stack_len = iseq->arg_size;
}
/* {|&b|} */
if (iseq->arg_block != -1) {
- VALUE procval = Qnil;
+ VALUE procval = Qnil;
- if (blockptr) {
+ if (blockptr) {
if (blockptr->proc == 0) {
procval = rb_vm_make_proc(th, blockptr, rb_cProc);
}
else {
procval = blockptr->proc;
}
- }
+ }
- argv[iseq->arg_block] = procval;
+ argv[iseq->arg_block] = procval;
}
th->mark_stack_len = 0;