Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
bcfe2931
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bcfe2931
编写于
4月 28, 2015
作者:
A
AlekseyTs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use more accurate assert condition in BuildMembersAndInitializers.
Fixes #2349.
上级
3f37d97b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
39 addition
and
30 deletion
+39
-30
src/Compilers/VisualBasic/Portable/Symbols/Source/SourceMemberContainerTypeSymbol.vb
...ortable/Symbols/Source/SourceMemberContainerTypeSymbol.vb
+39
-30
未找到文件。
src/Compilers/VisualBasic/Portable/Symbols/Source/SourceMemberContainerTypeSymbol.vb
浏览文件 @
bcfe2931
...
@@ -1699,44 +1699,53 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
...
@@ -1699,44 +1699,53 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
End
Property
End
Property
#If DEBUG Then
#If DEBUG Then
' Thread id to catch cases where ComputeMembersAndInitializers
' A thread local hash table to catch cases when BuildMembersAndInitializers
' is called recursively. This does not catch all recursive cases,
' is called recursively for the same symbol.
' only cases where the method is called recursively on the first
<
ThreadStatic
>
' thread that called ComputeMembersAndInitializers.
Private
Shared
s_SymbolsBuildingMembersAndInitializers
As
HashSet
(
Of
SourceMemberContainerTypeSymbol
)
Private
_computingMembersThreadId
As
Integer
#End If
#End If
Private
Function
BuildMembersAndInitializers
(
diagBag
As
DiagnosticBag
)
As
MembersAndInitializers
Private
Function
BuildMembersAndInitializers
(
diagBag
As
DiagnosticBag
)
As
MembersAndInitializers
Dim
membersAndInitializers
As
MembersAndInitializers
#If DEBUG Then
#If DEBUG Then
Dim
threadId
=
Environment
.
CurrentManagedThreadId
If
s_SymbolsBuildingMembersAndInitializers
Is
Nothing
Then
s_SymbolsBuildingMembersAndInitializers
=
New
HashSet
(
Of
SourceMemberContainerTypeSymbol
)(
ReferenceEqualityComparer
.
Instance
)
End
If
Dim
added
As
Boolean
=
s_SymbolsBuildingMembersAndInitializers
.
Add
(
Me
)
' Bug 1098580 tracks re-enabling this assert.
Debug
.
Assert
(
added
)
'Debug.Assert(m_computingMembersThreadId <> threadId)
Try
Interlocked
.
CompareExchange
(
_computingMembersThreadId
,
threadId
,
0
)
#End If
#End If
' Get type members
' Get type members
Dim
typeMembers
=
GetTypeMembersDictionary
()
Dim
typeMembers
=
GetTypeMembersDictionary
()
' Get non-type members
' Get non-type members
Dim
membersAndInitializers
As
M
embersAndInitializers
=
BuildNonTypeMembers
(
diagBag
)
m
embersAndInitializers
=
BuildNonTypeMembers
(
diagBag
)
_defaultPropertyName
=
DetermineDefaultPropertyName
(
membersAndInitializers
.
Members
,
diagBag
)
_defaultPropertyName
=
DetermineDefaultPropertyName
(
membersAndInitializers
.
Members
,
diagBag
)
' Find/process partial methods
' Find/process partial methods
ProcessPartialMethodsIfAny
(
membersAndInitializers
.
Members
,
diagBag
)
ProcessPartialMethodsIfAny
(
membersAndInitializers
.
Members
,
diagBag
)
' Merge types with non-types
' Merge types with non-types
For
Each
typeSymbols
In
typeMembers
.
Values
For
Each
typeSymbols
In
typeMembers
.
Values
Dim
nontypeSymbols
As
ImmutableArray
(
Of
Symbol
)
=
Nothing
Dim
nontypeSymbols
As
ImmutableArray
(
Of
Symbol
)
=
Nothing
Dim
name
=
typeSymbols
(
0
).
Name
Dim
name
=
typeSymbols
(
0
).
Name
If
Not
membersAndInitializers
.
Members
.
TryGetValue
(
name
,
nontypeSymbols
)
Then
If
Not
membersAndInitializers
.
Members
.
TryGetValue
(
name
,
nontypeSymbols
)
Then
membersAndInitializers
.
Members
.
Add
(
name
,
StaticCast
(
Of
Symbol
).
From
(
typeSymbols
))
membersAndInitializers
.
Members
.
Add
(
name
,
StaticCast
(
Of
Symbol
).
From
(
typeSymbols
))
Else
Else
membersAndInitializers
.
Members
(
name
)
=
nontypeSymbols
.
Concat
(
StaticCast
(
Of
Symbol
).
From
(
typeSymbols
))
membersAndInitializers
.
Members
(
name
)
=
nontypeSymbols
.
Concat
(
StaticCast
(
Of
Symbol
).
From
(
typeSymbols
))
End
If
End
If
Next
Next
#If DEBUG Then
#If DEBUG Then
Interlocked
.
CompareExchange
(
_computingMembersThreadId
,
0
,
threadId
)
Finally
If
added
Then
s_SymbolsBuildingMembersAndInitializers
.
Remove
(
Me
)
End
If
End
Try
#End If
#End If
Return
membersAndInitializers
Return
membersAndInitializers
End
Function
End
Function
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录