diff --git a/lib/Parser/Parse.cpp b/lib/Parser/Parse.cpp index cdb983a2c24..14b0dd921d3 100644 --- a/lib/Parser/Parse.cpp +++ b/lib/Parser/Parse.cpp @@ -13455,6 +13455,13 @@ DeferredFunctionStub * BuildDeferredStubTree(ParseNode *pnodeFnc, Recycler *recy } AssertOrFailFast(i < nestedCount); + if (pnodeChild->sxFnc.pnodeBody != nullptr) + { + // Anomalous case of a non-deferred function nested within a deferred one. + // Work around by discarding the stub tree. + return nullptr; + } + if (pnodeChild->sxFnc.IsGeneratedDefault()) { ++i;