mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Merged DMD commit 91a91bcb7882d76e2afd844f14697a75175573d2:
bugzilla 5230 Regression(2.041, 1.057) ICE(tocsym.c) overriding a method that has an out contract
This commit is contained in:
13
dmd/func.c
13
dmd/func.c
@@ -1660,6 +1660,19 @@ Statement *FuncDeclaration::mergeFensure(Statement *sf)
|
||||
for (int i = 0; i < foverrides.dim; i++)
|
||||
{
|
||||
FuncDeclaration *fdv = (FuncDeclaration *)foverrides.data[i];
|
||||
|
||||
/* The semantic pass on the contracts of the overridden functions must
|
||||
* be completed before code generation occurs (bug 3602 and 5230).
|
||||
*/
|
||||
if (fdv->fdensure && fdv->fdensure->semanticRun != PASSsemantic3done)
|
||||
{
|
||||
assert(fdv->scope);
|
||||
Scope *sc = fdv->scope->push();
|
||||
sc->stc &= ~STCoverride;
|
||||
fdv->semantic3(sc);
|
||||
sc->pop();
|
||||
}
|
||||
|
||||
sf = fdv->mergeFensure(sf);
|
||||
if (fdv->fdensure)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user