Skip to content

Commit

Permalink
Fix issue 7699 - Cannot get frame pointer to in contract when compili…
Browse files Browse the repository at this point in the history
…ng with -inline

Disable inlining in the case when it fails (which is when a class is involved).
  • Loading branch information
don-clugston-sociomantic committed Mar 14, 2012
1 parent 2c3e9a8 commit 01b740e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/inline.c
Original file line number Diff line number Diff line change
Expand Up @@ -1486,6 +1486,9 @@ int FuncDeclaration::canInline(int hasthis, int hdrscan, int statementsToo)
if (
!fbody ||
ident == Id::ensure || // ensure() has magic properties the inliner loses
(ident == Id::require && // require() has magic properties too
toParent()->isFuncDeclaration() && // see bug 7699
toParent()->isFuncDeclaration()->needThis()) ||
!hdrscan &&
(
#if 0
Expand Down
14 changes: 14 additions & 0 deletions test/runnable/testcontracts.d
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,20 @@ void test7218()
size_t baz()/*in{} out{}*/body{ return 0; } // NG2
}

/*******************************************/
// 7699

class P7699
{
void f(int n) in {
assert (n);
} body { }
}
class D7699 : P7699
{
void f(int n) in { } body { }
}

/*******************************************/

int main()
Expand Down

0 comments on commit 01b740e

Please sign in to comment.