[Issue 5178] New: StructLiteral should not be lvalue
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Nov 6 03:50:22 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5178
Summary: StructLiteral should not be lvalue
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: accepts-invalid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: k.hara.pg at gmail.com
--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2010-11-06 03:49:16 PDT ---
Created an attachment (id=802)
Patch for DMD svn r737
This code generates wrong code.
struct S{}
void swap(ref S a, ref S b){}
ref S get(){return S();} //should be rejected
void main(){
swap(get(), get());
}
In function swap, a and b access invalid local stack address.
I think StructLiteral should not be lvalue, but current dmd allows it.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list