[Issue 3602] ICE(tocsym.c) compiling a class, if its super class has preconditions

2017-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3602

--- Comment #11 from github-bugzi...@puremagic.com ---
Commit pushed to stable at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/b79c250bc27659274aa3a93473cd8f550738e3ad
Handle bug 3602 and 5230, add tests for them.

--


[Issue 3602] ICE(tocsym.c) compiling a class, if its super class has preconditions

2014-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3602

Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

Version|1.051   |D1

--


[Issue 3602] ICE(tocsym.c) compiling a class, if its super class has preconditions

2010-09-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3602


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

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


--- Comment #10 from Walter Bright bugzi...@digitalmars.com 2010-09-22 
06:24:00 PDT ---
http://www.dsource.org/projects/dmd/changeset/683

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


[Issue 3602] ICE(tocsym.c) compiling a class, if its super class has preconditions

2010-09-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3602


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

   Keywords||patch


--- Comment #9 from Don clugd...@yahoo.com.au 2010-09-15 05:15:58 PDT ---
PATCH: func.c, line 1658, FuncDeclaration::mergeFrequire()


for (int i = 0; i  foverrides.dim; i++)
{
FuncDeclaration *fdv = (FuncDeclaration *)foverrides.data[i];
+/* The semantic pass on the contracts of the overridden functions must
+ * be completed before code generation occurs (bug 3602).
+*/
+if (fdv-fdrequire  fdv-fdrequire-semanticRun !=
PASSsemantic3done)
+{
+assert(fdv-scope);
+fdv-semantic3(fdv-scope);
+}
sf = fdv-mergeFrequire(sf);
if (fdv-fdrequire)
{
//printf(fdv-frequire: %s\n, fdv-frequire-toChars());

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


[Issue 3602] ICE(tocsym.c) compiling a class, if its super class has preconditions

2010-06-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3602



--- Comment #5 from Don clugd...@yahoo.com.au 2010-06-15 00:00:53 PDT ---
(In reply to comment #4)
 The given testcase is invalid.  However, by fixing the errors, it's
 reproducible under Windows.

?? I had no trouble reproducing it under Windows.
Until around DMD 1.050, it used to compile, but that was only because contract
inheritance was silently ignored. This code has never worked properly. OTOH I
agree that it has the importance of a regression.

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


[Issue 3602] ICE(tocsym.c) compiling a class, if its super class has preconditions

2010-06-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3602



--- Comment #6 from Stewart Gordon s...@iname.com 2010-06-15 01:39:17 PDT ---
(In reply to comment #5)
 (In reply to comment #4)
  The given testcase is invalid.  However, by fixing the errors, it's
  reproducible under Windows.
 
 ?? I had no trouble reproducing it under Windows.
 Until around DMD 1.050, it used to compile, but that was only because contract
 inheritance was silently ignored. This code has never worked properly. OTOH I
 agree that it has the importance of a regression.

That's very weird.  How did it use to handle the fact that Box is an undefined
symbol in ImageBox.d?

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


[Issue 3602] ICE(tocsym.c) compiling a class, if its super class has preconditions

2010-06-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3602


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #7 from bearophile_h...@eml.cc 2010-06-15 02:47:30 PDT ---
I have not seen the ICE but this asserts (v2.047 with warnings):


class A {
   void foo(int x)
   in {
   assert(x  0); // asserts
   } body {}
}
class B : A {
   override void foo(int y) {}
}
void main() {
auto b = new B;
b.foo(10);
}

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


[Issue 3602] ICE(tocsym.c) compiling a class, if its super class has preconditions

2010-06-15 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3602



--- Comment #8 from Stewart Gordon s...@iname.com 2010-06-15 02:52:55 PDT ---
(In reply to comment #7)
assert(x  0); // asserts

Could hardly state the obvious more - unless there was something else you meant
to say

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


[Issue 3602] ICE(tocsym.c) compiling a class, if its super class has preconditions

2010-06-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3602


Stewart Gordon s...@iname.com changed:

   What|Removed |Added

 CC||s...@iname.com
   Platform|Other   |All
 OS/Version|Linux   |All
   Severity|critical|regression


--- Comment #4 from Stewart Gordon s...@iname.com 2010-06-14 18:30:05 PDT ---
The given testcase is invalid.  However, by fixing the errors, it's
reproducible under Windows:

- imagebox.d -
module imagebox;
import box;

class ImageBox: Box {
   override void paint(int x, int y)
   in {
   assert(x  0);
   assert(y  0);
   }
   body {
   }
}
- box.d -
module box;
class Box {
   void paint(int x, int y)
   in {
   assert(x  0);
   assert(y  0);
   }
   body {
   }
}
--
C:\Users\Stewart\Documents\Programming\D\Tests\bugs\bz3602dmd -c imagebox.d
box.d(5): Error: function __require forward declaration
linkage = 0
Assertion failure: '0' on line 381 in file 'tocsym.c'

abnormal program termination
--

This has broken SDWF.

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


[Issue 3602] ICE(tocsym.c) compiling a class, if its super class has preconditions

2010-04-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3602


Robert Clipsham rob...@octarineparrot.com changed:

   What|Removed |Added

 CC||rob...@octarineparrot.com


--- Comment #3 from Robert Clipsham rob...@octarineparrot.com 2010-04-03 
13:18:21 BST ---
*** Issue 4055 has been marked as a duplicate of this issue. ***

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


[Issue 3602] ICE(tocsym.c) compiling a class, if its super class has preconditions

2010-01-27 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3602



--- Comment #2 from Don clugd...@yahoo.com.au 2010-01-27 00:46:38 PST ---
This is crashing because the contracts are implemented as functions fdrequire,
fdensure, which are NESTED functions of the function ('paint()') being called.
fdrequire-semantic() and fdensure-semantic() need to be run before code
generation of the overridden function.

Because they're nested functions, fdrequire-semantic() is called when running
semantic3() on 'box.paint()'.
But, if because box.paint() was only imported, box.paint()-semantic3() never
gets run!

To fix the bug, we need to make sure that fdrequire-semantic() does get called
sometime before code generation. I've tried running it immediately after
fdrequire is created; that allows the test case to compile when the two modules
are compiled separately, but it causes a different ICE when they are compiled
together. I also tried running semantic() from inside mergeRequire(), but I
wasn't successful.

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