https://issues.dlang.org/show_bug.cgi?id=17879
Issue ID: 17879
Summary: UFCS can enable some forms of hijacking
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
>From Timon Gehr:
struct S{
// string foo(){ return "hijacked!"; } // uncomment to hijack
}
string foo(S s){ return "not hijacked!"; }
void main(){
S s;
import std.stdio;
writeln(s.foo());
}
--
