{
struct variable *v;
- if (primary->merged)
- // shouldn't happen
- primary = primary->merged; // NOTEST
+ primary = primary->merged;
for (v = primary->previous; v; v=v->previous)
if (v == secondary || v == secondary->merged ||
v->merged == secondary ||
- (v->merged && v->merged == secondary->merged)) {
+ v->merged == secondary->merged) {
v->scope = OutScope;
v->merged = primary;
}
v->previous = b->var;
b->var = v;
v->name = b;
+ v->merged = v;
v->min_depth = v->depth = c->scope_depth;
v->scope = InScope;
v->in_scope = c->in_scope;
struct variable *v;
for (v = b->var; v; v = v->previous) {
struct type *t = v->type;
- if (v->merged && v->merged != v)
+ if (v->merged != v)
continue;
if (v->global)
continue;
type_err(c, "%d:BUG: no variable!!", prog, NULL, 0, NULL); // NOTEST
return Tnone; // NOTEST
}
- if (v->merged)
- v = v->merged;
+ v = v->merged;
if (v->constant && (rules & Rnoconstant)) {
type_err(c, "error: Cannot assign to a constant: %v",
prog, NULL, 0, NULL);
struct var *var = cast(var, e);
struct variable *v = var->var;
- if (v->merged)
- v = v->merged; // UNTESTED
+ v = v->merged;
lrv = var_value(c, v);
rvtype = v->type;
break;
{
struct variable *v = cast(var, b->left)->var;
struct value *val;
- if (v->merged)
- v = v->merged;
+ v = v->merged;
val = var_value(c, v);
free_value(v->type, val);
if (v->type->prepare_type)