>>>>> "n" == nobu nokada <nobu.nokada / softhome.net> writes:

n> But it means to push a dummy dvar *after* the expression.
 
 No it is in top_local_init(), i.e. this will be the first node executed by
 ruby when it enter in "#{...}"

n> [ruby-core:00053] pushes a dummy dvar *before* NODE_DSTR etc.

 and this is an error for the case

   "#{a = 12}"
   eval "x = 12"

 `x' is now a dynamic variable, where normally it must be a local variable.


>> If I'm right ruby just need to test if the number of local variable was
>> modified before executing the nodes (i.e. just after the label default: in
>> NODE_DSTR). If this is true it must reallocate ruby_scope->local_vars and
>> perhaps remake 'ruby_scope->local_tbl = node->nd_tbl'

n> How about variables defined in eval?

 I don't see where is the problem : ruby must execute the node (in
 NODE_DSTR) with the right value for ruby_scope->local_vars and
 ruby_scope->local_tbl, this is why it must test if it has the right value
 before executing the nodes (because another thread has modified it, this
 is the lines

            if (ruby_scope->local_tbl) {
                NODE *body = (NODE *)ruby_scope->scope_node;
                if (body && body->nd_tbl != ruby_scope->local_tbl) {
                   if (body->nd_tbl) free(body->nd_tbl);
                   ruby_scope->local_vars[-1] =
                   (VALUE)(body->nd_tbl = ruby_scope->local_tbl;
          }

 These modifications was made for the current thread (i.e. the thread which
 has compiled the node) but not for all threads



Guy Decoux