[Issue 13534] New: std.variant can violate memory safety
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Sep 26 01:33:26 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13534
Issue ID: 13534
Summary: std.variant can violate memory safety
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: Phobos
Assignee: nobody at puremagic.com
Reporter: ttanjo at gmail.com
The following code can be compiled in dmd v2.067-devel-590d4a9 but it should
not.
------
import std.variant;
void main() @safe {
auto foo() @system { return 3; }
auto v = Variant(&foo);
v(); // foo is called in safe code!?
}
------
Currently whole part of std.variant is marked as trusted but it should not
because the safety of the functions or methods in this module
depends on the components which are stored in VariantN, Algebraic etc.
--
More information about the Digitalmars-d-bugs
mailing list