Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
b291cb05
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,发现更多精彩内容 >>
提交
b291cb05
编写于
3月 09, 2015
作者:
V
Vladimir Reshetnikov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Ignore bit flag AssemblyFlags.PublicKey for assembly definitions
上级
fa8065f2
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
35 addition
and
18 deletion
+35
-18
src/Compilers/CSharp/Test/Emit/Attributes/InternalsVisibleToAndStrongNameTests.cs
...t/Emit/Attributes/InternalsVisibleToAndStrongNameTests.cs
+2
-2
src/Compilers/Core/Portable/MetadataReader/PEModule.cs
src/Compilers/Core/Portable/MetadataReader/PEModule.cs
+29
-12
src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/PseudoVariableTests.cs
...tor/CSharp/Test/ExpressionCompiler/PseudoVariableTests.cs
+2
-2
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/PseudoVariableTests.vb
...isualBasic/Test/ExpressionCompiler/PseudoVariableTests.vb
+2
-2
未找到文件。
src/Compilers/CSharp/Test/Emit/Attributes/InternalsVisibleToAndStrongNameTests.cs
浏览文件 @
b291cb05
...
@@ -1650,8 +1650,8 @@ internal void Foo()
...
@@ -1650,8 +1650,8 @@ internal void Foo()
}
}
}
}
[
Fact
(
Skip
=
"Bug 399"
)
]
[
Fact
]
[
WorkItem
(
399
,
"
GitHub
"
)]
[
WorkItem
(
399
,
"
https://github.com/dotnet/roslyn/issues/399
"
)]
public
void
Bug399
()
public
void
Bug399
()
{
{
// The referenced assembly Signed.dll from the repro steps
// The referenced assembly Signed.dll from the repro steps
...
...
src/Compilers/Core/Portable/MetadataReader/PEModule.cs
浏览文件 @
b291cb05
...
@@ -474,14 +474,18 @@ internal AssemblyIdentity ReadAssemblyIdentityOrThrow()
...
@@ -474,14 +474,18 @@ internal AssemblyIdentity ReadAssemblyIdentityOrThrow()
throw
new
BadImageFormatException
(
string
.
Format
(
CodeAnalysisResources
.
InvalidAssemblyName
,
nameStr
));
throw
new
BadImageFormatException
(
string
.
Format
(
CodeAnalysisResources
.
InvalidAssemblyName
,
nameStr
));
}
}
string
cultureName
=
(!
culture
.
IsNil
)
?
reader
.
GetString
(
culture
)
:
null
;
string
cultureName
=
culture
.
IsNil
?
null
:
reader
.
GetString
(
culture
)
;
if
(
cultureName
!=
null
&&
!
MetadataHelpers
.
IsValidMetadataIdentifier
(
cultureName
))
if
(
cultureName
!=
null
&&
!
MetadataHelpers
.
IsValidMetadataIdentifier
(
cultureName
))
{
{
throw
new
BadImageFormatException
(
string
.
Format
(
CodeAnalysisResources
.
InvalidCultureName
,
cultureName
));
throw
new
BadImageFormatException
(
string
.
Format
(
CodeAnalysisResources
.
InvalidCultureName
,
cultureName
));
}
}
var
hasPublicKey
=
(
flags
&
AssemblyFlags
.
PublicKey
)
!=
0
;
ImmutableArray
<
byte
>
publicKeyOrToken
=
reader
.
GetBlobContent
(
publicKey
);
var
publicKeyOrToken
=
!
publicKey
.
IsNil
?
reader
.
GetBlobBytes
(
publicKey
).
AsImmutableOrNull
()
:
default
(
ImmutableArray
<
byte
>);
bool
hasPublicKey
;
if
(
isReference
)
{
hasPublicKey
=
(
flags
&
AssemblyFlags
.
PublicKey
)
!=
0
;
if
(
hasPublicKey
)
if
(
hasPublicKey
)
{
{
if
(!
MetadataHelpers
.
IsValidPublicKey
(
publicKeyOrToken
))
if
(!
MetadataHelpers
.
IsValidPublicKey
(
publicKeyOrToken
))
...
@@ -489,17 +493,30 @@ internal AssemblyIdentity ReadAssemblyIdentityOrThrow()
...
@@ -489,17 +493,30 @@ internal AssemblyIdentity ReadAssemblyIdentityOrThrow()
throw
new
BadImageFormatException
(
CodeAnalysisResources
.
InvalidPublicKey
);
throw
new
BadImageFormatException
(
CodeAnalysisResources
.
InvalidPublicKey
);
}
}
}
}
else
if
(
isReference
)
else
{
{
if
(!
publicKeyOrToken
.
IsDefaultOrEmpty
&&
publicKeyOrToken
.
Length
!=
AssemblyIdentity
.
PublicKeyTokenSize
)
if
(!
publicKeyOrToken
.
IsEmpty
&&
publicKeyOrToken
.
Length
!=
AssemblyIdentity
.
PublicKeyTokenSize
)
{
{
throw
new
BadImageFormatException
(
CodeAnalysisResources
.
InvalidPublicKeyToken
);
throw
new
BadImageFormatException
(
CodeAnalysisResources
.
InvalidPublicKeyToken
);
}
}
}
}
}
else
else
{
{
// Assembly definitions do not contain public key tokens, but they may contain public key
// Assembly definitions never contain a public key token, they only can have a full key or nothing,
// data without being marked as strong name signed (e.g. delay-signed assemblies).
// so the flag AssemblyFlags.PublicKey does not make sense for them and is ignored.
// See Ecma-335, Partition II Metadata, 22.2 "Assembly : 0x20".
// This also corresponds to the behavior of the native C# compiler and sn.exe tool.
hasPublicKey
=
!
publicKeyOrToken
.
IsEmpty
;
if
(
hasPublicKey
&&
!
MetadataHelpers
.
IsValidPublicKey
(
publicKeyOrToken
))
{
throw
new
BadImageFormatException
(
CodeAnalysisResources
.
InvalidPublicKey
);
}
}
if
(
publicKeyOrToken
.
IsEmpty
)
{
publicKeyOrToken
=
default
(
ImmutableArray
<
byte
>);
publicKeyOrToken
=
default
(
ImmutableArray
<
byte
>);
}
}
...
...
src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/PseudoVariableTests.cs
浏览文件 @
b291cb05
...
@@ -1050,8 +1050,8 @@ static void M()
...
@@ -1050,8 +1050,8 @@ static void M()
context
.
CompileExpression
(
context
.
CompileExpression
(
// typeof(Exception), typeof(A<B<object>>), typeof(B<A<object>[]>)
// typeof(Exception), typeof(A<B<object>>), typeof(B<A<object>[]>)
InspectionContextFactory
.
Empty
.
Add
(
"$exception"
,
"System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
).
InspectionContextFactory
.
Empty
.
Add
(
"$exception"
,
"System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
).
Add
(
"1"
,
"A`1[[B`1[[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], 397300B0-B, Version=1.2.2.2, Culture=neutral, PublicKeyToken=null]], 397300B0-A, Version=2.1.2.1, Culture=neutral, PublicKeyToken=
null
"
).
Add
(
"1"
,
"A`1[[B`1[[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], 397300B0-B, Version=1.2.2.2, Culture=neutral, PublicKeyToken=null]], 397300B0-A, Version=2.1.2.1, Culture=neutral, PublicKeyToken=
1f8a32457d187bf3
"
).
Add
(
"2"
,
"B`1[[A`1[[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]][], 397300B0-A, Version=2.1.2.1, Culture=neutral, PublicKeyToken=
null
]], 397300B0-B, Version=1.2.2.2, Culture=neutral, PublicKeyToken=null"
),
Add
(
"2"
,
"B`1[[A`1[[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]][], 397300B0-A, Version=2.1.2.1, Culture=neutral, PublicKeyToken=
1f8a32457d187bf3
]], 397300B0-B, Version=1.2.2.2, Culture=neutral, PublicKeyToken=null"
),
"(object)$exception ?? (object)$1 ?? $2"
,
"(object)$exception ?? (object)$1 ?? $2"
,
DkmEvaluationFlags
.
TreatAsExpression
,
DkmEvaluationFlags
.
TreatAsExpression
,
DiagnosticFormatter
.
Instance
,
DiagnosticFormatter
.
Instance
,
...
...
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/PseudoVariableTests.vb
浏览文件 @
b291cb05
...
@@ -859,8 +859,8 @@ End Class"
...
@@ -859,8 +859,8 @@ End Class"
' GetType(Exception), GetType(A(Of B(Of Object))), GetType(B(Of A(Of Object)()))
' GetType(Exception), GetType(A(Of B(Of Object))), GetType(B(Of A(Of Object)()))
context
.
CompileExpression
(
context
.
CompileExpression
(
InspectionContextFactory
.
Empty
.
Add
(
"$exception"
,
"System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
).
InspectionContextFactory
.
Empty
.
Add
(
"$exception"
,
"System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
).
Add
(
"1"
,
"A`1[[B`1[[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], 397300B1-B, Version=1.2.2.2, Culture=neutral, PublicKeyToken=null]], 397300B1-A, Version=2.1.2.1, Culture=neutral, PublicKeyToken=
null
"
).
Add
(
"1"
,
"A`1[[B`1[[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], 397300B1-B, Version=1.2.2.2, Culture=neutral, PublicKeyToken=null]], 397300B1-A, Version=2.1.2.1, Culture=neutral, PublicKeyToken=
1f8a32457d187bf3
"
).
Add
(
"2"
,
"B`1[[A`1[[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]][], 397300B1-A, Version=2.1.2.1, Culture=neutral, PublicKeyToken=
null
]], 397300B1-B, Version=1.2.2.2, Culture=neutral, PublicKeyToken=null"
),
Add
(
"2"
,
"B`1[[A`1[[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]][], 397300B1-A, Version=2.1.2.1, Culture=neutral, PublicKeyToken=
1f8a32457d187bf3
]], 397300B1-B, Version=1.2.2.2, Culture=neutral, PublicKeyToken=null"
),
"If(If($exception, $1), $2)"
,
"If(If($exception, $1), $2)"
,
DkmEvaluationFlags
.
TreatAsExpression
,
DkmEvaluationFlags
.
TreatAsExpression
,
DiagnosticFormatter
.
Instance
,
DiagnosticFormatter
.
Instance
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录