[Issue 14138] New: std.parallelism.task breaks @safety
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Feb 6 17:38:41 PST 2015
https://issues.dlang.org/show_bug.cgi?id=14138
Issue ID: 14138
Summary: std.parallelism.task breaks @safety
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Keywords: safe
Severity: enhancement
Priority: P1
Component: Phobos
Assignee: nobody at puremagic.com
Reporter: code at klickverbot.at
---
struct Oops {
int convert() {
*cast(int*)0xcafebabe = 0xdeadbeef;
return 0;
}
alias convert this;
}
void main() @safe {
import std.parallelism;
static void foo(int) @safe {}
auto t = task(&foo, Oops.init);
// or: auto t = scopedTask(&foo, Oops.init);
taskPool.put(t);
}
---
Tested with current Git master (4de96a06, to-be 2.067), but looks like the
issues has been present since the initial merge of std.parallelism.
Again a case of @trusted used on a template function without sufficient
constraints.
--
More information about the Digitalmars-d-bugs
mailing list