mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 15:40:55 +03:00
Another nested context crash fix.
The test case that would previously crash: a.d --- module a; @property bool empty(T)(in T[] a) { return !a.length; } void find(alias pred,R1)(R1 haystack) { simpleMindedFind!pred(haystack); } void simpleMindedFind(alias pred, R1)(R1 haystack) { bool haystackTooShort() { return haystack.empty; } } --- b.d --- module b; import c; void getTimeZone() { indexOf(); } --- c.d --- module c; import a; void indexOf()() { find!({})(""); } ---
This commit is contained in:
parent
11f19eec5a
commit
3f448afa37
1 changed files with 36 additions and 33 deletions
|
@ -392,6 +392,9 @@ static void DtoCreateNestedContextType(FuncDeclaration* fd) {
|
||||||
unsigned depth = -1;
|
unsigned depth = -1;
|
||||||
if (!fd->isStatic()) {
|
if (!fd->isStatic()) {
|
||||||
if (FuncDeclaration* parfd = getParentFunc(fd, true)) {
|
if (FuncDeclaration* parfd = getParentFunc(fd, true)) {
|
||||||
|
// Make sure parfd->ir.irFunc has already been set.
|
||||||
|
DtoDeclareFunction(parfd);
|
||||||
|
|
||||||
innerFrameType = parfd->ir.irFunc->frameType;
|
innerFrameType = parfd->ir.irFunc->frameType;
|
||||||
if (innerFrameType)
|
if (innerFrameType)
|
||||||
depth = parfd->ir.irFunc->depth;
|
depth = parfd->ir.irFunc->depth;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue