File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -581,6 +581,20 @@ void FuncDeclaration::toObjFile(int multiobj)
581
581
// if (!(config.flags3 & CFG3pic))
582
582
// s->Sclass = SCstatic;
583
583
f -> Fflags3 |= Fnested ;
584
+
585
+ /* The enclosing function must have its code generated first,
586
+ * so we know things like where its local symbols are stored.
587
+ */
588
+ FuncDeclaration * fdp = toParent2 ()-> isFuncDeclaration ();
589
+ if (fdp && fdp -> semanticRun == PASSsemantic3done &&
590
+ !fdp -> isUnitTestDeclaration ())
591
+ {
592
+ /* Can't do unittest's out of order, they are order dependent in that their
593
+ * execution is done in lexical order, and some modules (std.datetime *cough*
594
+ * *cough*) rely on this.
595
+ */
596
+ fdp -> toObjFile (multiobj );
597
+ }
584
598
}
585
599
else
586
600
{
You can’t perform that action at this time.
0 commit comments