This revision was automatically updated to reflect the committed changes.
Closed by commit rL285637: [analyzer] MacOSXAPIChecker: Improve warnings for
__block vars in dispatch_once. (authored by dergachev).
Changed prior to commit:
https://reviews.llvm.org/D26159?vs=76453=76478#toc
NoQ added a comment.
> FIXME: The analyzer sets stack memory space for __block variables when they
> are referenced outside the block (eg. test_block_var_from_outside_block()
> line 108). Will try to fix in a separate patch; i'm not relying on the memory
> space in this patch.
That's actually
dcoughlin accepted this revision.
dcoughlin added a comment.
This revision is now accepted and ready to land.
LGTM.
We should probably be warning any time the address of a block variable is taken
since the address is not stable -- but that's a job for a different checker or
possibly even Sema.
NoQ created this revision.
NoQ added reviewers: zaks.anna, dcoughlin.
NoQ added a subscriber: cfe-commits.
The checker already warns for `__block`-storage variables being used as a
`dispatch_once()` predicate, however it refers to them as local which is not
quite accurate, so we fix that.
Also