Fix stack overflow compiling deeply nested generic
As a part of implementing nullable reference types many of our locals switched from `TypeSymbol` to `TypeSymbolWithAnnotations`. In the vast majority of cases this doesn't have a meaningful impact on compilation. They are bigger (about 3X) but it's still a relatively small `struct` (three words). The size difference is significant though in `BindNamespaceOrTypeOrAliasSymbol`. This method is used in recursive parts of binding and is mutually recursive with `BindQualifiedNam`. This method defines a large number of locals which contribute to every layer of recursion. When they moved to `TypeSymbolWithAnnotations` this pushed us outside our tolerance levels and we hit an overflow in extreme cases. Virtually none of these locals are used in the recursive case. Factored their use into local functions so we only pay the stack usage on demand. closes #33909 fixes https://github.com/dotnet/coreclr/issues/22757
Showing
想要评论请 注册 或 登录