[macruby-changes] [4536] MacRuby/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Thu Sep 23 14:33:13 PDT 2010
Revision: 4536
http://trac.macosforge.org/projects/ruby/changeset/4536
Author: lsansonetti at apple.com
Date: 2010-09-23 14:33:11 -0700 (Thu, 23 Sep 2010)
Log Message:
-----------
#require: forget about the current binding during parsing
Modified Paths:
--------------
MacRuby/trunk/load.c
MacRuby/trunk/vm.cpp
Modified: MacRuby/trunk/load.c
===================================================================
--- MacRuby/trunk/load.c 2010-09-23 00:44:01 UTC (rev 4535)
+++ MacRuby/trunk/load.c 2010-09-23 21:33:11 UTC (rev 4536)
@@ -87,7 +87,15 @@
// Load it.
const char *fname_str = RSTRING_PTR(fname);
//printf("load %s\n", fname_str);
+
+ rb_vm_binding_t *b = rb_vm_current_binding();
+ if (b != NULL) {
+ rb_vm_pop_binding();
+ }
NODE *node = (NODE *)rb_load_file(fname_str);
+ if (b != NULL) {
+ rb_vm_add_binding(b);
+ }
if (node == NULL) {
rb_raise(rb_eSyntaxError, "compile error");
}
Modified: MacRuby/trunk/vm.cpp
===================================================================
--- MacRuby/trunk/vm.cpp 2010-09-23 00:44:01 UTC (rev 4535)
+++ MacRuby/trunk/vm.cpp 2010-09-23 21:33:11 UTC (rev 4536)
@@ -3734,7 +3734,7 @@
if (create) {
GC_WB(l, xmalloc(sizeof(rb_vm_local_t)));
(*l)->name = name;
- GC_WB(&(*l)->value, xmalloc(sizeof(VALUE)));
+ GC_WB(&(*l)->value, xmalloc(sizeof(VALUE *)));
(*l)->next = NULL;
return (*l)->value;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100923/c6c576e5/attachment.html>
More information about the macruby-changes
mailing list