[Issue 3344] ICE(e2ir.c) returning an invalid function from main()

2009-09-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3344


Don  changed:

   What|Removed |Added

   Keywords|ice-on-valid-code   |ice-on-invalid-code, patch
Summary|ICE(e2ir.c) returning a |ICE(e2ir.c) returning an
   |void function from main()   |invalid function from
   ||main()


--- Comment #2 from Don  2009-09-29 01:24:49 PDT ---
This is clearly invalid code.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3344] ICE(e2ir.c) returning an invalid function from main()

2009-09-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3344



--- Comment #3 from Don  2009-09-29 01:24:55 PDT ---
This is happening because when return exp; is changed into exp; return;, the 
semantic pass never gets run on the expression.

---
PATCH: iin statement.c, around line 3464, in Statement 
*ReturnStatement::semantic(Scope *sc)

=
/* Replace:
 *return exp;
 * with:
 *exp; return;
 */
Statement *s = new ExpStatement(loc, exp);
+s->semantic(sc); 
==

CAUTION:
This patch also disallows code like " void foo() { return 7; }"
This shows up several bugs in Phobos and in the DMD test suite.
If there's a reason why such bug-prone code should continue to be accepted, a 
more complicated patch will be required.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3344] ICE(e2ir.c) returning an invalid function from main()

2009-10-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3344


Walter Bright  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||FIXED


--- Comment #4 from Walter Bright  2009-10-13 
13:48:24 PDT ---
Fixed dmd 1.049 and 2.034

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---