switch (v ? v->scope : OutScope) {
case OutScope:
case PendingScope:
- /* Signal an error - once that is possible */
+ /* Caller will report the error */
return NULL;
case CondScope:
/* All CondScope variables of this name need to be merged
static void var_block_close(struct parse_context *c, enum closetype ct)
{
- /* close of all variables that are in_scope */
+ /* Close off all variables that are in_scope */
struct variable *v, **vp, *v2;
scope_pop(c);
for (vp = &c->in_scope;
v = *vp, v && v->depth > c->scope_depth && v->min_depth > c->scope_depth;
) {
- switch (ct) {
+ if (v->name->var == v) switch (ct) {
case CloseElse:
case CloseParallel: /* handle PendingScope */
switch(v->scope) {
}
break;
}
- if (v->scope == OutScope)
+ if (v->scope == OutScope || v->name->var != v)
*vp = v->in_scope;
else
vp = &v->in_scope;