Rework DFA traversal (#18016)

* enable using dbg: without a context

* Optimally joining first write/last read analysis

* Add test for #18002

* potLastReads -> potentialLastReads
This commit is contained in:
Clyybber 2021-05-16 00:15:53 +02:00 • committed by GitHub
commit 3614523664
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 133 additions and 109 deletions

View file

@ -784,3 +784,37 @@ proc main3 =
main3()
# misc
proc smoltest(x: bool): bool =
while true:
if true: return x
discard smoltest(true)
# bug #18002
type
TTypeAttachedOp = enum
attachedAsgn
attachedSink
attachedTrace
PNode = ref object
discard
proc genAddrOf(n: PNode) =
assert n != nil, "moved?!"
proc atomicClosureOp =
let x = PNode()
genAddrOf:
block:
x
case attachedTrace
of attachedSink: discard
of attachedAsgn: discard
of attachedTrace: genAddrOf(x)
atomicClosureOp()