Skip to content

Commit

Permalink
Remove shortcut edges. Again. Add returnForm basic block to touched.
Browse files Browse the repository at this point in the history
  • Loading branch information
gsvgit committed Dec 26, 2023
1 parent e51b0dd commit 79a8807
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion VSharp.IL/CFG.fs
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ type ApplicationGraph(getNextBasicBlockGlobalId,applicationGraphDelta:Applicatio
let callFrom = callSource.BasicBlock
let callTo = calledMethodCfgInfo.EntryPoint
let exists, location = callerMethodCfgInfo.Calls.TryGetValue callSource.BasicBlock

if not <| callTo.IncomingCallEdges.Contains callFrom then
let mutable returnTo = callFrom
// if not exists then it should be from exception mechanism
Expand All @@ -570,11 +571,13 @@ type ApplicationGraph(getNextBasicBlockGlobalId,applicationGraphDelta:Applicatio
returnFrom.OutgoingEdges.Add(dummyTerminalForReturnEdge, HashSet [|returnTo|])
let added = returnTo.IncomingCallEdges.Add returnFrom
assert added
let added = applicationGraphDelta.TouchedBasicBlocks.Add returnFrom
()
)

let added = callTo.IncomingCallEdges.Add callFrom
assert added
let removed = callFrom.OutgoingEdges.Remove CallGraph.dummyTerminalForCallShortcut
let removed = callFrom.OutgoingEdges.Remove CfgInfo.TerminalForCFGEdge //CallGraph.dummyTerminalForCallShortcut
assert removed
else ()

Expand Down

0 comments on commit 79a8807

Please sign in to comment.