Skip to content

Commit

Permalink
merge fix
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Apr 9, 2011
2 parents 2393347 + 7d9c5c8 commit ef2a0f1
Show file tree
Hide file tree
Showing 4 changed files with 1,180 additions and 493 deletions.
2 changes: 1 addition & 1 deletion src/declaration.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ VarDeclaration::VarDeclaration(Loc loc, Type *type, Identifier *id, Initializer
aliassym = NULL;
onstack = 0;
canassign = 0;
value = NULL;
setValueNull();
}

Dsymbol *VarDeclaration::syntaxCopy(Dsymbol *s)
Expand Down
14 changes: 12 additions & 2 deletions src/declaration.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,18 @@ struct VarDeclaration : Declaration
// 2: on stack, run destructor anyway
int canassign; // it can be assigned to
Dsymbol *aliassym; // if redone as alias to another symbol
Expression *value; // when interpreting, this is the value
// (NULL if value not determinable)

// When interpreting, these hold the value (NULL if value not determinable)
// The various functions are used only to detect compiler CTFE bugs
Expression *literalvalue;
Expression *getValue() { return literalvalue; }
void setValueNull();
void setValueWithoutChecking(Expression *newval);
void createRefValue(Expression *newval); // struct or array literal
void setRefValue(Expression *newval);
void setStackValue(Expression *newval);
void createStackValue(Expression *newval);

#if DMDV2
VarDeclaration *rundtor; // if !NULL, rundtor is tested at runtime to see
// if the destructor should be run. Used to prevent
Expand Down
Loading

0 comments on commit ef2a0f1

Please sign in to comment.