mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-06 19:06:02 +03:00
Fix check if nested function can access outer function frame
The previous check wouldn't check intermediate aggregates for static-ness, that was one problem. The other was the assertion that the outer function can be reached as long as there are no static functions inbetween, which isn't always the case, as issue #1864 clearly shows, which is resolved by this.
This commit is contained in:
parent
734398a225
commit
0de021fe32
5 changed files with 31 additions and 37 deletions
|
@ -852,7 +852,7 @@ void DtoDefineFunction(FuncDeclaration *fd, bool linkageAvailableExternally) {
|
|||
// data from the template function itself, but it would still mess up our
|
||||
// nested context creation code.
|
||||
FuncDeclaration *parent = fd;
|
||||
while ((parent = getParentFunc(parent, true))) {
|
||||
while ((parent = getParentFunc(parent))) {
|
||||
if (parent->semanticRun != PASSsemantic3done || parent->semantic3Errors) {
|
||||
IF_LOG Logger::println(
|
||||
"Ignoring nested function with unanalyzed parent.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue