<html>
<head>
<base href="http://bugzilla.gdcproject.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Error building core/thread.d"
href="http://bugzilla.gdcproject.org/show_bug.cgi?id=196#c12">Comment # 12</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Error building core/thread.d"
href="http://bugzilla.gdcproject.org/show_bug.cgi?id=196">bug 196</a>
from <span class="vcard"><a class="email" href="mailto:johannespfau@gmail.com" title="Johannes Pfau <johannespfau@gmail.com>"> <span class="fn">Johannes Pfau</span></a>
</span></b>
<pre>Smaller test case:
----------------------------------------
class ThreadError {}
void foo()
{
__gshared error = new ThreadError();
}
----------------------------------------
Only happens for classes, not for structs. AFAICS this code creates two things:
* A variable in the data segment, properly named
_D4test3fooFZ5errorC4test11ThreadError
(A pointer, as classes are reference types)
* The result of ThreadError() interpreted in CTFE
the data pointed to by D4test3fooFZ11ThreadErrorC4test11ThreadError, unnamed.
BTW:
The unnamed variable is also in rodata instead of data, which is wrong:
----------------------------------------
class ThreadError
{
int a;
}
void main()
{
__gshared error = new ThreadError();
error.a = 1;
}
----------------------------------------
segmentation fault (core dumped) ./a.out
(works with dmd 2.068, haven't tested 2.066)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>