提交 6bbea65e 编写于 作者: S Steffen Forkmann

Limit number of scopes in a method to avoid Stack Overflow in PDBWriter - fixes #1536

上级 b62f97c2
......@@ -470,13 +470,13 @@ let writePdbInfo fixupOverlappingSequencePoints showTimes f fpdb info =
pdbDefineSequencePoints !pdbw (getDocument spset.[0].Document) sps)
// Write the scopes
let rec writePdbScope top sco =
if top || sco.Locals.Length <> 0 || sco.Children.Length <> 0 then
let rec writePdbScope level sco =
if level = 0 || (level < 450 && (sco.Locals.Length <> 0 || sco.Children.Length <> 0)) then
pdbOpenScope !pdbw sco.StartOffset
sco.Locals |> Array.iter (fun v -> pdbDefineLocalVariable !pdbw v.Name v.Signature v.Index)
sco.Children |> Array.iter (writePdbScope false)
sco.Children |> Array.iter (writePdbScope (level + 1))
pdbCloseScope !pdbw sco.EndOffset
writePdbScope true minfo.RootScope
writePdbScope 0 minfo.RootScope
pdbCloseMethod !pdbw
end)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册