diff options
Diffstat (limited to 'lib/Sema/Scope.cpp')
-rw-r--r-- | lib/Sema/Scope.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Sema/Scope.cpp b/lib/Sema/Scope.cpp index 6c79778823..35e2075b38 100644 --- a/lib/Sema/Scope.cpp +++ b/lib/Sema/Scope.cpp @@ -39,6 +39,9 @@ void Scope::Init(Scope *parent, unsigned flags) { BlockParent = parent->BlockParent; TemplateParamParent = parent->TemplateParamParent; MSLocalManglingParent = parent->MSLocalManglingParent; + SEHTryParent = parent->SEHTryParent; + if (parent->Flags & SEHTryScope) + SEHTryParent = parent; if ((Flags & (FnScope | ClassScope | BlockScope | TemplateParamScope | FunctionPrototypeScope | AtCatchScope | ObjCMethodScope)) == 0) @@ -47,13 +50,17 @@ void Scope::Init(Scope *parent, unsigned flags) { Depth = 0; PrototypeDepth = 0; PrototypeIndex = 0; - MSLocalManglingParent = FnParent = BlockParent = nullptr; + SEHTryParent = MSLocalManglingParent = FnParent = BlockParent = nullptr; TemplateParamParent = nullptr; MSLocalManglingNumber = 1; } // If this scope is a function or contains breaks/continues, remember it. if (flags & FnScope) FnParent = this; + SEHTryIndexPool = 0; + SEHTryIndex = -1; + if (flags & SEHTryScope) + SEHTryIndex = FnParent ? FnParent->SEHTryIndexPool++ : -1; // The MS mangler uses the number of scopes that can hold declarations as // part of an external name. if (Flags & (ClassScope | FnScope)) { |