Thread overview | ||||||||
---|---|---|---|---|---|---|---|---|
|
April 05, 2010 [Issue 4067] New: [CTFE] Maybe ignored code in CTFE | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=4067 Summary: [CTFE] Maybe ignored code in CTFE Product: D Version: future Platform: x86 OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: bearophile_hugs@eml.cc --- Comment #0 from bearophile_hugs@eml.cc 2010-04-05 05:52:22 PDT --- Usually I show here minimal programs that contain the bug, but this time I show a bigger small program. This is a small benchmark I've adapted from the old Shootout code, it tests the performance of exceptions (on dmd they are very slow). I use this code both at compile time and run time. It contains a printf and exceptions that can't be used in CTFE, but this program compiles with dmd v.2.042 and prints 0/0 at ctfe. import std.c.stdio: printf; class LoException : Exception { this() { super(null); } } class HiException : Exception { this() { super(null); } } struct HiLo { int hi, lo; } struct App { int hi, lo, count; void someFunction() { try { hiFunction(); } catch (Exception e) { printf("We shouldn't get here\n"); } } void hiFunction() { try { loFunction(); } catch (HiException) { hi++; } } void loFunction() { try { blowUp(); } catch (LoException) { lo++; } } void blowUp() { if (count & 1) throw new HiException(); else throw new LoException(); } auto go(int n) { for (count = 0; count < n; count++) someFunction(); return HiLo(hi, lo); } } void main() { enum int n = 1000; App app; HiLo result1 = app.go(n); // OK printf("excepts(%d) hi|lo = %d | %d\n", n, result1.hi, result1.lo); enum HiLo result2 = app.go(n); // Err printf("excepts(%d) hi|lo = %d | %d\n", n, result2.hi, result2.lo); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
April 06, 2010 [Issue 4067] [CTFE] Code inside try-catch blocks is silently ignored | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=4067 Don <clugdbug@yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code CC| |clugdbug@yahoo.com.au Summary|[CTFE] Maybe ignored code |[CTFE] Code inside |in CTFE |try-catch blocks is | |silently ignored --- Comment #1 from Don <clugdbug@yahoo.com.au> 2010-04-06 06:30:42 PDT --- This should generate an error, until exceptions are supported in CTFE. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
April 28, 2010 [Issue 4067] [CTFE] Code inside try-catch blocks is silently ignored | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=4067 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla@digitalmars.com --- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2010-04-28 08:31:02 PDT --- changeset 457 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
May 06, 2010 [Issue 4067] [CTFE] Code inside try-catch blocks is silently ignored | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=4067 Don <clugdbug@yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #3 from Don <clugdbug@yahoo.com.au> 2010-05-05 19:09:17 PDT --- Fixed DMD2.044 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation