digitalmars.D.bugs - [Issue 6506] New: OS X: wrong value is passed to simple argument with a lazy parameter with -unittest -release -O
- d-bugmail puremagic.com (42/42) Aug 16 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6506
- d-bugmail puremagic.com (33/33) Aug 16 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6506
- d-bugmail puremagic.com (15/15) Aug 16 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6506
http://d.puremagic.com/issues/show_bug.cgi?id=6506 Summary: OS X: wrong value is passed to simple argument with a lazy parameter with -unittest -release -O Product: D Version: D2 Platform: Other OS/Version: Mac OS X Status: NEW Keywords: wrong-code Severity: major Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: kennytm gmail.com --- Comment #0 from kennytm gmail.com 2011-08-16 10:58:09 PDT --- ---------------------------- void enforce6506(bool condition, lazy int m) { assert(!condition); } void toImpl6506(int value) { enforce6506(value >= 0, 4); } void bug6506() { toImpl6506(-112345); } void main() { bug6506(); } ---------------------------- $ dmd -unittest -release -O z.d $ ./z core.exception.AssertError z(2): Assertion failure ... ---------------------------- The bug _does_not_ appear when: - one of '-unittest', '-release', and '-O' doesn't exist. - the type of 'condition' is not 'bool', 'u?(byte|short|int)' and '[wd]?char'. - the 'lazy' argument doesn't exist. This bug is preventing OS X from passing Phobos' unit test in the release build after fixing bug 6377. See also https://github.com/D-Programming-Language/phobos/commit/994d76fe. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 16 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6506 kennytm gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|OS X: wrong value is passed |OS X: wrong value is passed |to simple argument with a |to simple argument along |lazy parameter with |with a delegate with -O |-unittest -release -O | --- Comment #1 from kennytm gmail.com 2011-08-16 11:50:31 PDT --- Correction: 1. Only -O is needed. 2. It's not 'lazy' causing the bug, but passing a nested delegate. ------------------------------- void enforce6506b(bool condition, void delegate() m) { assert(!condition); } void toImpl6506b(int value) { void f(){} enforce6506b(value >= 0, &f); } void bug6506b() { toImpl6506b(-112345); } void main() { bug6506b(); } ------------------------------- $ dmd -O z.d $ ./z core.exception.AssertError z(2): Assertion failure ... ------------------------------- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 16 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6506 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla digitalmars.com Resolution| |FIXED --- Comment #2 from Walter Bright <bugzilla digitalmars.com> 2011-08-16 18:50:20 PDT --- The bug is actually there on all platforms (it's a scheduler problem), it just fails in a way that doesn't show on the others. https://github.com/D-Programming-Language/dmd/commit/7ce30cbf691d9adb377da273ca5fe465dd00ff41 https://github.com/D-Programming-Language/dmd/commit/564a2d0a0a1cb52b2536d00cd364b0a3502f302e -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 16 2011