Thread overview |
---|
July 10, 2008 [Issue 2216] New: bad code generation for static arrays of zero length static arrays | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=2216 Summary: bad code generation for static arrays of zero length static arrays Product: D Version: 1.029 Platform: PC OS/Version: Linux Status: NEW Keywords: wrong-code Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: tomas@famolsen.dk simple test case: int[0][10] arr; printf("%u\n", &arr[9] - &arr[0]); Output: Floating point exeption The crash happens due to the pointer subtraction dividing by size 0: AST: (&arr[9] - &arr[0]) / 0 this should just print a 0. -- |
July 11, 2008 [Issue 2216] bad code generation for static arrays of zero length static arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2216 tomas@famolsen.dk changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |trivial ------- Comment #1 from tomas@famolsen.dk 2008-07-11 13:53 ------- Marking as trivial. Just return zero if stride==0. -- |
August 14, 2008 [Issue 2216] bad code generation for static arrays of zero length static arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2216 bugzilla@digitalmars.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #2 from bugzilla@digitalmars.com 2008-08-14 02:59 ------- Fixed dmd 1.034 and 2.018 -- |
Copyright © 1999-2021 by the D Language Foundation