[Issue 10108] Thread local slice to array literal references the same data

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10108 Andrei Alexandrescu changed: What|Removed |Added Version|unspecified |D2 --

[Issue 10108] Thread local slice to array literal references the same data

2013-11-21 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=10108 yebblies changed: What|Removed |Added Status|REOPENED|RESOLVED CC|

[Issue 10108] Thread local slice to array literal references the same data

2013-05-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10108 --- Comment #15 from Simen Kjaeraas 2013-05-21 12:41:56 PDT --- (In reply to comment #14) > import core.thread; > int[] arr = [1,2,3].dup; > > void main() { > auto t = new Thread({arr[0] = 3;}); > t.start(); >

[Issue 10108] Thread local slice to array literal references the same data

2013-05-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10108 Sean Kelly changed: What|Removed |Added CC||s...@invisibleduck.org --- Comment #14 f

Re: [Issue 10108] Thread local slice to array literal references the same data

2013-05-18 Thread Simen Kjaeraas
On Sat, 18 May 2013 16:59:53 +0200, Sean Kelly wrote: This is expected because the global is __gshared and there's therefore no type protection from doing this. If you want safe sharing, make the global shared. [snip] __gshared int[] gArr = [1,2,3]; int[] arr = gArr; Uhm, you are aware

Re: [Issue 10108] Thread local slice to array literal references the same data

2013-05-18 Thread Sean Kelly
This is expected because the global is __gshared and there's therefore no type protection from doing this. If you want safe sharing, make the global shared. On May 17, 2013, at 9:38 AM, d-bugm...@puremagic.com wrote: > http://d.puremagic.com/issues/show_bug.cgi?id=10108 > > > > --- Comment #

[Issue 10108] Thread local slice to array literal references the same data

2013-05-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10108 --- Comment #13 from Igor Stepanov 2013-05-18 00:46:39 PDT --- > > > int[] x = [1,2,3]; // should not be compiled > > It would be trivial to fix. As the initializer for static data must be a > compile time constant we'd just need to store t

[Issue 10108] Thread local slice to array literal references the same data

2013-05-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10108 --- Comment #12 from Martin Nowak 2013-05-17 17:13:57 PDT --- The simple fix is to only allow value types to have TLS initalizers and require static this() for everything else. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.

[Issue 10108] Thread local slice to array literal references the same data

2013-05-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10108 --- Comment #11 from Martin Nowak 2013-05-17 17:10:43 PDT --- > Asserts are generally included to show what currently PASSES, not what FAILS. OK, I always write unittests that should pass but I'll be more explicit. > In other words implicit

[Issue 10108] Thread local slice to array literal references the same data

2013-05-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10108 --- Comment #10 from Igor Stepanov 2013-05-17 16:25:34 PDT --- (In reply to comment #9) > I see. Once again, simplified: > > import core.thread; > > struct Foo { > int[] arr; > } > > Foo[] arr = [Foo([1,2,3])]; // Should have failed? (

[Issue 10108] Thread local slice to array literal references the same data

2013-05-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10108 --- Comment #9 from Simen Kjaeraas 2013-05-17 15:26:26 PDT --- I see. Once again, simplified: import core.thread; struct Foo { int[] arr; } Foo[] arr = [Foo([1,2,3])]; // Should have failed? (1) void main( ) { int* p = arr[0].arr.

[Issue 10108] Thread local slice to array literal references the same data

2013-05-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10108 Igor Stepanov changed: What|Removed |Added CC||wazar.leoll...@yahoo.com --- Comment

[Issue 10108] Thread local slice to array literal references the same data

2013-05-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10108 Simen Kjaeraas changed: What|Removed |Added CC||simen.kja...@gmail.com --- Comment #

[Issue 10108] Thread local slice to array literal references the same data

2013-05-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10108 Walter Bright changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 10108] Thread local slice to array literal references the same data

2013-05-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10108 Steven Schveighoffer changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|INV

[Issue 10108] Thread local slice to array literal references the same data

2013-05-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10108 --- Comment #4 from Alex R�nne Petersen 2013-05-17 20:12:27 CEST --- (In reply to comment #2) > When a thread local variable is a reference type to modifiable data, we must > make sure that it is initialized uniquely. > > This is what the cu

[Issue 10108] Thread local slice to array literal references the same data

2013-05-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10108 Steven Schveighoffer changed: What|Removed |Added CC||schvei...@yahoo.com --- Commen

[Issue 10108] Thread local slice to array literal references the same data

2013-05-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10108 --- Comment #2 from Martin Nowak 2013-05-17 09:38:22 PDT --- When a thread local variable is a reference type to modifiable data, we must make sure that it is initialized uniquely. This is what the current implementation does which results in

[Issue 10108] Thread local slice to array literal references the same data

2013-05-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10108 Alex R�nne Petersen changed: What|Removed |Added CC||a...@lycus.org --- Comment #1 f