www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15256] New: Data races with arrays allowed in safe code

https://issues.dlang.org/show_bug.cgi?id=15256

          Issue ID: 15256
           Summary: Data races with arrays allowed in  safe code
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: accepts-invalid, safe
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: dfj1esp02 sneakemail.com

 safe:
shared string s;
void f()  safe
{
    s="s";
}

A slice is stored with two mov instructions, so when the global variable is
modified concurrently, it can end up with pointer from one array and length
from another.

--
Oct 29 2015