injectdestructors fixes and refactor (#14964)
* injectdestructors fixes and refactor * Tiny cleanup * Refactor and expand testcase * Closes #14902 by adding testcase * Better naming * Fix test failures * Misc cleanup * Add testcase for #14968 * Better approach; expand testcases * Optimizations and fixes * Add testcase * typo * Tiny cleanup
This commit is contained in:
parent
f999f916f3
commit
2b0e336c97
6 changed files with 317 additions and 198 deletions
|
|
@ -628,7 +628,7 @@ proc isAnalysableFieldAccess*(orig: PNode; owner: PSym): bool =
|
|||
# XXX Allow closure deref operations here if we know
|
||||
# the owner controlled the closure allocation?
|
||||
result = n.kind == nkSym and n.sym.owner == owner and
|
||||
owner.kind != skModule and
|
||||
sfGlobal notin n.sym.flags and
|
||||
(n.sym.kind != skParam or isSinkParam(n.sym)) # or n.sym.typ.kind == tyVar)
|
||||
# Note: There is a different move analyzer possible that checks for
|
||||
# consume(param.key); param.key = newValue for all paths. Then code like
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue