Commit Graph

15 Commits

Author SHA1 Message Date
Devin Coughlin
ef4a89c479 [Exclusivity] Enforce exclusive access for class offsets in KeyPaths
Add dynamic enforcement of exclusive access when a KeyPath directly accesses a final
stored property on an instance of a class. For read-only projections, this begins and ends
the access immediately. For mutable projections, this uses the ClassHolder to perform
a long-term access that lasts as long as the lifetime of the ClassHolder.

rdar://problem/31972680
2018-04-19 21:37:12 -07:00
Saleem Abdulrasool
b67d5f0cf7 test: convert rm -rf && mkdir -p into %empty-directory
This converts the instances of the pattern for which we have a proper
substitution in lit.  This will make it easier to replace it
appropriately with Windows equivalents.
2018-03-06 14:30:54 -08:00
Devin Coughlin
51f835ed01 [Exclusivity] Additional tests for static and dynamic exclusivity.
Add more exclusivity tests. This includes a test for a known false
negative involving keypaths for class properties.

This is a test-only change.
2017-12-21 15:13:10 -08:00
Andrew Trick
3810b0cae9 Add runtime tests for dynamic exclusivity enforcement. 2017-06-20 00:01:52 -07:00
Kuba (Brecka) Mracek
a5a59f5aed [runtime] Enhance output from dynamic exclusivity violations. Print current stacktrace and the symbolicated frame of the previous conflicting access. (#9501) 2017-05-12 20:28:28 -07:00
John McCall
701752c4ff Merge pull request #9431 from rjmccall/dynamic-exclusivity-refinements
Dynamic exclusivity refinements
2017-05-11 02:31:03 -04:00
Andrew Trick
c76269ccd9 Comment typos. 2017-05-10 16:37:59 -07:00
John McCall
93243e5f69 Fix expected test output. 2017-05-10 14:47:39 -04:00
John McCall
ab250848b4 Downgrade dynamic exclusivity failures to a warning in Swift 3 compatibility mode. 2017-05-10 14:44:59 -04:00
practicalswift
8c40c65c80 [gardening] Fix typos. 2017-05-09 21:50:04 +02:00
Andrew Trick
dd31c40995 [Exclusivity] Disable dynamic enforcement in noescape closures. 2017-05-08 17:27:26 -07:00
Devin Coughlin
de9c646804 [Exclusivity] Use dynamic enforcement on boxes whose projections escape
In AccessEnforcementSelection, treat passing a projection from a box to
a partial_apply as an escape to force using dynamic enforcement on the box.

This will now correctly use dynamic enforcement on variables that are taken
as inout and also captured by storage address in a closure:

  var x = ...

  x.mutatingMethod { ... use x ...}

but does pessimize some of our existing enforcement into dynamic since
access enforcement selection.

Ideally we would distinguish between escaping via an nonescaping closures
(which can only conflict with accesses that are in progress) and
escaping via escaping closures (which can conflict for any reachable code
after the escape)
2017-05-02 14:54:12 -07:00
Andrew Trick
45967ceb4f [Exclusivity] Update tests for access markers. 2017-04-28 21:33:09 -07:00
Devin Coughlin
a85aedebd4 [Exclusivity] Add test for per-thread dynamic enforcement.
We intentionally do not trap on conflicting accesses from different threads.

This is a test-only change.
2017-04-28 08:28:56 -07:00
Devin Coughlin
73aabd73f7 [Exclusivity] Fix insertion/remove in AccessSet in runtime.
And add some basic tests for trapping on accesses to globals.
2017-04-27 15:38:07 -07:00