aboutsummaryrefslogtreecommitdiffstats
path: root/iseq.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-25 16:29:26 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-25 16:29:26 +0000
commit9987d53e519cf84fe47ffbbd4f48be0bc40938c7 (patch)
tree1cbd036967f588026bf6038c39898fa20a531e4b /iseq.c
parente98f7e1eaa18c33d211e6a0cf245eaf4b175c3c7 (diff)
downloadruby-9987d53e519cf84fe47ffbbd4f48be0bc40938c7.tar.gz
* yarvcore.h: add rb_thread_t#top_wrapper, top_self.
* eval_load.c (rb_load): support eval in wrapper module (load(file, true)). * eval.c: ditto. * eval_jump.h: ditto. * iseq.c: ditto. * vm.c: ditto. * yarvcore.c: ditto. * insns.def: add a empty line. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/iseq.c b/iseq.c
index 050ad03936..106c4dae8f 100644
--- a/iseq.c
+++ b/iseq.c
@@ -107,12 +107,14 @@ prepare_iseq_build(rb_iseq_t *iseq,
VALUE parent, VALUE type, VALUE block_opt,
const rb_compile_option_t *option)
{
+ rb_thread_t *th = GET_THREAD();
+
iseq->name = name;
iseq->defined_method_id = 0;
iseq->filename = filename;
iseq->iseq_mark_ary = rb_ary_new();
RBASIC(iseq->iseq_mark_ary)->klass = 0;
-
+
iseq->type = type;
iseq->arg_rest = 0;
iseq->arg_block = 0;
@@ -124,7 +126,7 @@ prepare_iseq_build(rb_iseq_t *iseq,
/* set class nest stack */
if (type == ISEQ_TYPE_TOP) {
/* toplevel is private */
- iseq->cref_stack = NEW_BLOCK(rb_cObject);
+ iseq->cref_stack = NEW_BLOCK(th->top_wrapper ? th->top_wrapper : rb_cObject);
iseq->cref_stack->nd_file = 0;
iseq->cref_stack->nd_visi = NOEX_PRIVATE;
}
@@ -144,17 +146,17 @@ prepare_iseq_build(rb_iseq_t *iseq,
RBASIC(iseq->compile_data->mark_ary)->klass = 0;
iseq->compile_data->storage_head = iseq->compile_data->storage_current =
- (struct iseq_compile_data_storage *)
- ALLOC_N(char, INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE +
+ (struct iseq_compile_data_storage *)
+ ALLOC_N(char, INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE +
sizeof(struct iseq_compile_data_storage));
iseq->compile_data->catch_table_ary = rb_ary_new();
iseq->compile_data->storage_head->pos = 0;
iseq->compile_data->storage_head->next = 0;
iseq->compile_data->storage_head->size =
- INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE;
+ INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE;
iseq->compile_data->storage_head->buff =
- (char *)(&iseq->compile_data->storage_head->buff + 1);
+ (char *)(&iseq->compile_data->storage_head->buff + 1);
iseq->compile_data->option = option;
if (type == ISEQ_TYPE_TOP ||