[Issue 12863] New: Crash in cast_.d on OSX 10.9
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Jun 5 19:44:34 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=12863
Issue ID: 12863
Summary: Crash in cast_.d on OSX 10.9
Product: D
Version: D2
Hardware: x86_64
OS: Mac OS X
Status: NEW
Severity: minor
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: tcdknutson at gmail.com
Tested on OSX 10.9, this will cause a segfault in dmd 2.065 in `cast_.d`, where
there should be none (it should just return null)
```
interface Node {}
interface WhereCondition {}
interface Whereable {}
class Where
{
Whereable left; // lhs
this(Whereable left ) {
this.left = left;
}
}
class Select : Whereable
{
WhereCondition[] projection;
this(WhereCondition[] projection...) {
this.projection = projection;
}
Where where()
{
return new Where(this);
}
}
class ATable
{
Where where() {
return (new Select(null)).where();
}
}
void main() {
auto users = new ATable();
auto where = users.where();
WhereCondition var = (cast(Select)where.left).projection[0];
auto var2 = cast(Node) var;
}
```
Removing the last line (auto var2 = ...) will cause the crash not to happen,
which makes me think the issue is arising when casting to `Node` from type
WhereCondition.
--
More information about the Digitalmars-d-bugs
mailing list