www.digitalmars.com         C & C++   DMDScript  

D - dmd 0.47 release

reply "Walter" <walter digitalmars.com> writes:
Fix Burton's reported bugs on arrays of small structs, and unit test
failures in stream.d.
Oct 22 2002
next sibling parent Patrick Down <pat codemoon.com> writes:
/*
Ok here is a fun one.  The following program crashes
at the line commented  "Crash right here!!"
But if I comment out the line stated in the
in the TableLayout class it does not crash.
*/


interface ILayout
{
  void setHostFrame(FrameWindow host);     
}

class FrameWindow 
{
  public 
  {
    void setLayout(ILayout lo)
    {
      printf("pointers are ok %p %p\n",this,lo);
      lo.setHostFrame(this); // Crash right here!!
      printf("Hey I didn't crash\n");
    }
  }
}

class TableLayout : ILayout
{
  public 
  {
    void setHostFrame(FrameWindow host)
    {
    }
  } 
  
  protected 
  {
    // Comment out the next line and I do not crash!
    bit         group; 
  } 
}


class MyWindow : FrameWindow
{
  public
  {
    this()
    {
      setLayout(new TableLayout());
    }
  }
}



int main(char[][] args)
{
  MyWindow appWin = new MyWindow();

  return 0;
}
Oct 22 2002
prev sibling next sibling parent Patrick Down <pat codemoon.com> writes:
Here is another weird one.  
This program should print "here"
but does not.

struct Size
{
  int width;
  int height;
}

void foo(out Size sz)
{
  sz.width = 0;
  
  if(sz.width == 0)
    printf("here\n"); // Does not do this line
}


int main(char[][] argv)
{
  Size sz;
  
  foo(sz);
  
  return 1;
}
Oct 22 2002
prev sibling next sibling parent Burton Radons <loth users.sourceforge.net> writes:
Walter wrote:
 Fix Burton's reported bugs on arrays of small structs, and unit test
 failures in stream.d.

That got all the problems, thanks! Tested with and without -O and with and without -release.
Oct 23 2002
prev sibling parent reply Burton Radons <loth users.sourceforge.net> writes:
The Stream constructor is flagged private:

     private this () { }

Which doesn't allow it to be subclassed outside of this module!
Oct 23 2002
parent "Walter" <walter digitalmars.com> writes:
Anyone know where Pavel is lately? <g>

"Burton Radons" <loth users.sourceforge.net> wrote in message
news:ap6ng8$2k0t$1 digitaldaemon.com...
 The Stream constructor is flagged private:

      private this () { }

 Which doesn't allow it to be subclassed outside of this module!

Oct 23 2002