Skip to content

Commit

Permalink
Do not inline unittest bodies when unittests are disabled - they have…
Browse files Browse the repository at this point in the history
…n't had semantic run on them.
  • Loading branch information
yebblies committed Nov 8, 2013
1 parent ea8e25b commit e1a52e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/declaration.h
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,7 @@ class UnitTestDeclaration : public FuncDeclaration
bool addPreInvariant();
bool addPostInvariant();
void emitComment(Scope *sc);
void inlineScan();
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);

UnitTestDeclaration *isUnitTestDeclaration() { return this; }
Expand Down
7 changes: 7 additions & 0 deletions src/inline.c
Original file line number Diff line number Diff line change
Expand Up @@ -1822,6 +1822,13 @@ Expression *FuncDeclaration::expandInline(InlineScanState *iss, Expression *ethi
return e;
}

void UnitTestDeclaration::inlineScan()
{
if (global.params.useUnitTests)
{
FuncDeclaration::inlineScan();
}
}

/****************************************************
* Perform the "inline copying" of a default argument for a function parameter.
Expand Down

0 comments on commit e1a52e1

Please sign in to comment.