Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
41296d72
F
fsharp
项目概览
dotNET Platform
/
fsharp
12 个月 前同步成功
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
fsharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
41296d72
编写于
7月 27, 2018
作者:
K
Kevin Ransom (msft)
提交者:
GitHub
7月 27, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5406 from KevinRansom/cherrypick_3
Cherrypick 3 --- better fix for #5369 (#5398)
上级
2020099e
8cecf334
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
29 addition
and
18 deletion
+29
-18
src/fsharp/TastPickle.fs
src/fsharp/TastPickle.fs
+29
-18
未找到文件。
src/fsharp/TastPickle.fs
浏览文件 @
41296d72
...
...
@@ -121,7 +121,6 @@ type WriterState =
onlerefs
:
Table
<
int
*
int
[]
>
osimpletys
:
Table
<
int
>
oglobals
:
TcGlobals
mutable
isStructThisArgPos
:
bool
ofile
:
string
/// Indicates if we are using in-memory format, where we store XML docs as well
oInMem
:
bool
...
...
@@ -506,9 +505,13 @@ let p_maybe_lazy p (x: MaybeLazy<_>) st =
p_lazy_impl
p
x
.
Value
st
let
p_hole
()
=
let
h
=
ref
(
None
:
'
T
pickler
option
)
let
h
=
ref
(
None
:
(
'
T
->
WriterState
->
unit
)
option
)
(
fun
f
->
h
:=
Some
f
),(
fun
x
st
->
match
!
h
with
Some
f
->
f
x
st
|
None
->
pfailwith
st
"p_hole: unfilled hole"
)
let
p_hole2
()
=
let
h
=
ref
(
None
:
(
'
Arg
->
'
T
->
WriterState
->
unit
)
option
)
(
fun
f
->
h
:=
Some
f
),(
fun
arg
x
st
->
match
!
h
with
Some
f
->
f
arg
x
st
|
None
->
pfailwith
st
"p_hole2: unfilled hole"
)
let
u_array_core
f
n
st
=
let
res
=
Array
.
zeroCreate
n
for
i
=
0
to
n
-
1
do
...
...
@@ -710,8 +713,7 @@ let pickleObjWithDanglingCcus inMem file g scope p x =
osimpletys
=
Table
<_>.
Create
"osimpletys"
oglobals
=
g
ofile
=
file
oInMem
=
inMem
isStructThisArgPos
=
false
}
oInMem
=
inMem
}
p
x
st1
let
sizes
=
st1
.
otycons
.
Size
,
...
...
@@ -733,8 +735,7 @@ let pickleObjWithDanglingCcus inMem file g scope p x =
osimpletys
=
Table
<_>.
Create
"osimpletys (fake)"
oglobals
=
g
ofile
=
file
oInMem
=
inMem
isStructThisArgPos
=
false
}
oInMem
=
inMem
}
p_tup7
(
p_array
p_encoded_ccuref
)
(
p_tup3
p_int
p_int
p_int
)
...
...
@@ -1266,7 +1267,9 @@ let u_rfref st = let a,b = u_tup2 u_tcref u_string st in RFRef(a,b)
let
u_tpref
st
=
u_local_item_ref
st
.
itypars
st
// forward reference
let
fill_p_ty
,
p_ty
=
p_hole
()
let
fill_p_ty2
,
p_ty2
=
p_hole2
()
let
p_ty
=
p_ty2
false
let
p_tys
=
(
p_list
p_ty
)
let
fill_p_attribs
,
p_attribs
=
p_hole
()
...
...
@@ -1291,9 +1294,7 @@ let p_nonlocal_val_ref (nlv:NonLocalValOrMemberRef) st =
match
key
.
TypeForLinkage
with
|
None
->
false
|
Some
ty
->
checkForInRefStructThisArg
st
ty
st
.
isStructThisArgPos
<-
isStructThisArgPos
p_option
p_ty
key
.
TypeForLinkage
st
st
.
isStructThisArgPos
<-
false
p_option
(
p_ty2
isStructThisArgPos
)
key
.
TypeForLinkage
st
let
rec
p_vref
ctxt
x
st
=
match
x
with
...
...
@@ -1553,9 +1554,17 @@ let u_tyar_spec st =
let
u_tyar_specs
=
(
u_list
u_tyar_spec
)
let
_
=
fill_p_ty
(
fun
ty
st
->
let
_
=
fill_p_ty
2
(
fun
isStructThisArgPos
ty
st
->
let
ty
=
stripTyparEqns
ty
let
ty
=
if
isInByrefTy
st
.
oglobals
ty
&&
st
.
isStructThisArgPos
then
destByrefTy
st
.
oglobals
ty
else
ty
// See comment on 'checkForInRefStructThisArg'
let
ty
=
if
isInByrefTy
st
.
oglobals
ty
&&
isStructThisArgPos
then
// Convert the inref to a byref
mkByrefTy
st
.
oglobals
(
destByrefTy
st
.
oglobals
ty
)
else
ty
match
ty
with
|
TType_tuple
(
tupInfo
,
l
)
->
if
evalTupInfoIsStruct
tupInfo
then
...
...
@@ -1566,11 +1575,15 @@ let _ = fill_p_ty (fun ty st ->
|
TType_app
(
tc
,
tinst
)
->
p_byte
2
st
;
p_tup2
(
p_tcref
"typ"
)
p_tys
(
tc
,
tinst
)
st
|
TType_fun
(
d
,
r
)
->
p_byte
3
st
p_ty
d
st
st
.
isStructThisArgPos
<-
false
// Note, the "this" argument may be found in the domain position of a function type, so propagate the isStructThisArgPos value
p_ty2
isStructThisArgPos
d
st
p_ty
r
st
|
TType_var
r
->
p_byte
4
st
;
p_tpref
r
st
|
TType_forall
(
tps
,
r
)
->
p_byte
5
st
;
p_tup2
p_tyar_specs
p_ty
(
tps
,
r
)
st
|
TType_forall
(
tps
,
r
)
->
p_byte
5
st
p_tyar_specs
tps
st
// Note, the "this" argument may be found in the body of a generic forall type, so propagate the isStructThisArgPos value
p_ty2
isStructThisArgPos
r
st
|
TType_measure
unt
->
p_byte
6
st
;
p_measure_expr
unt
st
|
TType_ucase
(
uc
,
tinst
)
->
p_byte
7
st
;
p_tup2
p_ucref
p_tys
(
uc
,
tinst
)
st
)
...
...
@@ -1838,9 +1851,7 @@ and p_ValData x st =
p_ranges
(
x
.
ValReprInfo
|>
Option
.
map
(
fun
_
->
x
.
val_range
,
x
.
DefinitionRange
))
st
let
isStructThisArgPos
=
x
.
IsMember
&&
checkForInRefStructThisArg
st
x
.
Type
st
.
isStructThisArgPos
<-
isStructThisArgPos
p_ty
x
.
val_type
st
st
.
isStructThisArgPos
<-
false
p_ty2
isStructThisArgPos
x
.
val_type
st
p_int64
x
.
val_flags
.
PickledBits
st
p_option
p_member_info
x
.
MemberInfo
st
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录