digitalmars.D.bugs - [Issue 5482] New: Crash with align(0)
- d-bugmail puremagic.com (32/32) Jan 25 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5482
- d-bugmail puremagic.com (11/11) Feb 10 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5482
- d-bugmail puremagic.com (11/15) Feb 10 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5482
- d-bugmail puremagic.com (11/11) Mar 01 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5482
http://d.puremagic.com/issues/show_bug.cgi?id=5482
Summary: Crash with align(0)
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody puremagic.com
ReportedBy: bearophile_hugs eml.cc
This crashes DMD 2.051:
align(0) struct Foo {
char c;
int i;
}
void main() {
Foo f = Foo();
}
---------------
This causes an Access Violation with DMD 2.051:
align(0) struct Foo {
int i, j;
}
void main() {
Foo f = Foo();
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 25 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5482 Cannot reproduce. The second case gives a runtime access violation, but neither example causes a compiler segfault. Is align(0) really valid? I don't think it makes sense. It's definitely illegal on Microsoft VC++, I don't see it documented on DMC++ or GCC, but in both cases it appears unlikely. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 10 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5482Cannot reproduce.You are right, to crash is the compiled program (with DMD 2.051 on Windows).The second case gives a runtime access violation, but neither example causes a compiler segfault.As in the first case this time the compiled program gives: object.Error: Access ViolationIs align(0) really valid? I don't think it makes sense.I agree, I suggest to turn it into a compile-time error (as negative numbers already do). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 10 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5482
Don <clugdbug yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
https://github.com/D-Programming-Language/dmd/commit/830011e21b22686932a65d1452965ae7589aadfc
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 01 2011









d-bugmail puremagic.com 