File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 1
1
Mon May 17 12:26:31 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
2
2
3
+ * numeric.c (fix_rev): should treat Fixnum as signed long.
4
+
5
+ * eval.c (massign): add strict number check for yield (and call).
6
+
7
+ * eval.c (proc_arity): new method to return number of arguments.
8
+
9
+ * eval.c (method_arity): new method to return number of arguments.
10
+
3
11
* parse.y (read_escape): char may be unsigned.
4
12
5
13
* string.c (rb_str_succ): ditto.
Original file line number Diff line number Diff line change @@ -5523,18 +5523,18 @@ proc_arity(proc)
5523
5523
int n ;
5524
5524
5525
5525
Data_Get_Struct (proc , struct BLOCK , data );
5526
- if (data -> var == 0 ) return 0 ;
5526
+ if (data -> var == 0 ) return FIX2INT ( -1 ) ;
5527
5527
switch (nd_type (data -> var )) {
5528
5528
default :
5529
- return INT2FIX (-1 );
5529
+ return INT2FIX (-2 );
5530
5530
case NODE_MASGN :
5531
5531
list = data -> var -> nd_head ;
5532
5532
n = 0 ;
5533
5533
while (list ) {
5534
5534
n ++ ;
5535
5535
list = list -> nd_next ;
5536
5536
}
5537
- if (data -> var -> nd_args ) return INT2FIX (- n );
5537
+ if (data -> var -> nd_args ) return INT2FIX (- n - 1 );
5538
5538
return INT2FIX (n );
5539
5539
}
5540
5540
}
@@ -5717,7 +5717,7 @@ method_arity(method)
5717
5717
body = body -> nd_head ;
5718
5718
if (!body ) return INT2FIX (0 );
5719
5719
n = body -> nd_cnt ;
5720
- if (body -> nd_rest ) n = - n ;
5720
+ if (body -> nd_rest ) n = - n - 1 ;
5721
5721
return INT2FIX (n );
5722
5722
}
5723
5723
}
Original file line number Diff line number Diff line change @@ -1100,7 +1100,7 @@ static VALUE
1100
1100
fix_rev (num )
1101
1101
VALUE num ;
1102
1102
{
1103
- unsigned long val = FIX2ULONG (num );
1103
+ long val = FIX2LONG (num );
1104
1104
1105
1105
val = ~val ;
1106
1106
return rb_int2inum (val );
You can’t perform that action at this time.
0 commit comments