mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* compile.c (iseq_build_from_ary): fix expression to obtain
iseq->local_size and iseq->local_table_size. [ruby-dev:35205] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6b20b1e464
commit
266a84c904
2 changed files with 6 additions and 8 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Tue Jun 24 00:10:53 2008 wanabe <s.wanabe@gmail.com>
|
||||||
|
* compile.c (iseq_build_from_ary): fix expression to obtain
|
||||||
|
iseq->local_size and iseq->local_table_size. [ruby-dev:35205]
|
||||||
|
|
||||||
Mon Jun 23 11:31:41 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Mon Jun 23 11:31:41 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* lib/mathn.rb (Rational::power2): removed incomplete method.
|
* lib/mathn.rb (Rational::power2): removed incomplete method.
|
||||||
|
|
10
compile.c
10
compile.c
|
@ -4983,22 +4983,16 @@ iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
|
||||||
VALUE exception, VALUE body)
|
VALUE exception, VALUE body)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int opt = 0;
|
|
||||||
ID *tbl;
|
ID *tbl;
|
||||||
struct st_table *labels_table = st_init_numtable();
|
struct st_table *labels_table = st_init_numtable();
|
||||||
|
|
||||||
DECL_ANCHOR(anchor);
|
DECL_ANCHOR(anchor);
|
||||||
|
|
||||||
INIT_ANCHOR(anchor);
|
INIT_ANCHOR(anchor);
|
||||||
if (iseq->type == ISEQ_TYPE_METHOD ||
|
|
||||||
iseq->type == ISEQ_TYPE_TOP ||
|
|
||||||
iseq->type == ISEQ_TYPE_CLASS) {
|
|
||||||
opt = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
iseq->local_table_size = opt + RARRAY_LEN(locals);
|
iseq->local_table_size = RARRAY_LEN(locals);
|
||||||
iseq->local_table = tbl = (ID *)ALLOC_N(ID *, iseq->local_table_size);
|
iseq->local_table = tbl = (ID *)ALLOC_N(ID *, iseq->local_table_size);
|
||||||
iseq->local_size = opt + iseq->local_table_size;
|
iseq->local_size = iseq->local_table_size + 1;
|
||||||
|
|
||||||
for (i=0; i<RARRAY_LEN(locals); i++) {
|
for (i=0; i<RARRAY_LEN(locals); i++) {
|
||||||
VALUE lv = RARRAY_PTR(locals)[i];
|
VALUE lv = RARRAY_PTR(locals)[i];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue