Skip to content

Commit

Permalink
Update VarDeclaration::init by init->semantic result
Browse files Browse the repository at this point in the history
The returned `Initializer` object may be different from `init`.
  • Loading branch information
9rnsr committed Oct 2, 2013
1 parent 39d11fa commit c386380
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/declaration.c
Expand Up @@ -2107,7 +2107,7 @@ Expression *VarDeclaration::getConstInitializer(bool needFullType)
if (scope)
{
inuse++;
init->semantic(scope, type, INITinterpret);
init = init->semantic(scope, type, INITinterpret);
scope = NULL;
inuse--;
}
Expand Down
2 changes: 1 addition & 1 deletion src/expression.c
Expand Up @@ -3565,7 +3565,7 @@ Expression *DsymbolExp::semantic(Scope *sc)
if (v->scope)
{
v->inuse++;
v->init->semantic(v->scope, v->type, INITinterpret);
v->init = v->init->semantic(v->scope, v->type, INITinterpret);
v->scope = NULL;
v->inuse--;
}
Expand Down
2 changes: 1 addition & 1 deletion src/interpret.c
Expand Up @@ -2210,7 +2210,7 @@ Expression *getVarExp(Loc loc, InterState *istate, Declaration *d, CtfeGoal goal
#endif
{
if(v->scope)
v->init->semantic(v->scope, v->type, INITinterpret); // might not be run on aggregate members
v->init = v->init->semantic(v->scope, v->type, INITinterpret); // might not be run on aggregate members
e = v->init->toExpression(v->type);
if (v->inuse)
{
Expand Down

0 comments on commit c386380

Please sign in to comment.