more precise borrow checking of 'result' (#15406)

This commit is contained in:
Andreas Rumpf 2020-09-24 22:07:23 +02:00 • committed by GitHub
commit e3b5f80a89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View file

@ -1248,7 +1248,7 @@ proc trackProc*(c: PContext; s: PSym, body: PNode) =
if not t.hasSideEffect and t.hasDangerousAssign:
t.hasSideEffect = varpartitions.hasSideEffect(partitions, mutationInfo)
if views in c.features:
checkBorrowedLocations(partitions, g.config)
checkBorrowedLocations(partitions, body, g.config)
if sfThread in s.flags and t.gcUnsafe:
if optThreads in g.config.globalOptions and optThreadAnalysis in g.config.globalOptions: