www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Bug when initializing multiple variables by static opCall (dmd v0.113)

reply "Stefan B." <stefankjb yahoo.com> writes:
Hi!

I am new to D and every now and then I get some errors that seem like 
bugs. I didn't find any bug report system so am I expected to report here?

struct Pose
{
   vec3 mTranslate;
   quat mRotate;
   vec3 mScale;
   static Pose opCall()
   {
     Pose p;
     p.mTranslate = vec3(0,0,0);
     p.mRotate.identity();
     p.mScale = vec3(1,1,1);
     return p;
   }
}

void test()
{
   Pose mDefaultPose;
   Pose mCurrentPose;

   mCurrentPose = mDefaultPose = Pose(); // ERROR

   mCurrentPose = Pose(); // NO
   mDefaultPose = Pose(); // ERROR
}

dmd -Isrc -Isrc/gl -Isrc/wrappers -g -c -ofsrc/mesh.o src/mesh.d
Internal error: ../ztc/cgcod.c 1464
scons: *** [src/mesh.o] Error 1
scons: building terminated because of errors.

-Stefan B.
Feb 23 2005
next sibling parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
 I am new to D and every now and then I get some errors that seem like 
 bugs. I didn't find any bug report system so am I expected to report here?
Almost. You are right about the bug report system, but there is a digitalmars.D.bugs newsgroup right next to this one... --anders
Feb 23 2005
parent reply Lars Ivar Igesund <larsivar igesund.net> writes:
Anders F Björklund wrote:
 I am new to D and every now and then I get some errors that seem like 
 bugs. I didn't find any bug report system so am I expected to report 
 here?
Almost. You are right about the bug report system, but there is a digitalmars.D.bugs newsgroup right next to this one... --anders
Also, your code isn't complete. As Derek showed, the problem is most likely caused by what you're not showing. Trunkate the code until you have a minimal example showing the behaviour. The lesser snippet, the bigger the chance that it's fixed fast. In my experience, crash bugs are often caused by missing parts in your own code (or erranous parts). You should check if your vec3/quat structs (classes?) are fully and / or correctly implemented for your use. Lars Ivar Igesund
Feb 23 2005
parent "Stefan B." <stefankjb yahoo.com> writes:
Lars Ivar Igesund wrote:
 Anders F Björklund wrote:
 
 I am new to D and every now and then I get some errors that seem like 
 bugs. I didn't find any bug report system so am I expected to report 
 here?
Almost. You are right about the bug report system, but there is a digitalmars.D.bugs newsgroup right next to this one... --anders
Also, your code isn't complete. As Derek showed, the problem is most likely caused by what you're not showing. Trunkate the code until you have a minimal example showing the behaviour. The lesser snippet, the bigger the chance that it's fixed fast. In my experience, crash bugs are often caused by missing parts in your own code (or erranous parts). You should check if your vec3/quat structs (classes?) are fully and / or correctly implemented for your use. Lars Ivar Igesund
I used the simplified test case that Derek compiled succesfully. For me it still gives Internal error. (I changed test() to main() and saved to test.d). test.d:
 struct Pose
 {
    int mTranslate;
    int mRotate;
    int mScale;
    static Pose opCall()
    {
      Pose p;
      p.mTranslate = 1;
      p.mRotate = 2;
      p.mScale = 3;
      return p;
    }
 }

 void main()
 {
    Pose mDefaultPose;
    Pose mCurrentPose;

    mCurrentPose = mDefaultPose = Pose(); // Still ERROR

    mCurrentPose = Pose(); // NO
    mDefaultPose = Pose(); // ERROR
 }
~$ dmd test.d Internal error: ../ztc/cgcod.c 1464 I am Debian Linux user. Just wanted to be helpful. I'll use digitalmars.D.bugs in future... - Stefan B.
Feb 23 2005
prev sibling parent Derek <derek psych.ward> writes:
On Wed, 23 Feb 2005 21:32:59 +0200, Stefan B. wrote:

 Hi!
 
 I am new to D and every now and then I get some errors that seem like 
 bugs. I didn't find any bug report system so am I expected to report here?
 
 struct Pose
 {
    vec3 mTranslate;
    quat mRotate;
    vec3 mScale;
    static Pose opCall()
    {
      Pose p;
      p.mTranslate = vec3(0,0,0);
      p.mRotate.identity();
      p.mScale = vec3(1,1,1);
      return p;
    }
 }
 
 void test()
 {
    Pose mDefaultPose;
    Pose mCurrentPose;
 
    mCurrentPose = mDefaultPose = Pose(); // ERROR
 
    mCurrentPose = Pose(); // NO
    mDefaultPose = Pose(); // ERROR
 }
 
 dmd -Isrc -Isrc/gl -Isrc/wrappers -g -c -ofsrc/mesh.o src/mesh.d
 Internal error: ../ztc/cgcod.c 1464
 scons: *** [src/mesh.o] Error 1
 scons: building terminated because of errors.
Not knowing what the 'vec3' and 'quat' etc were, I changed your code to that below it and compiled okay. (Windows) struct Pose { int mTranslate; int mRotate; int mScale; static Pose opCall() { Pose p; p.mTranslate = 1; p.mRotate = 2; p.mScale = 3; return p; } } void test() { Pose mDefaultPose; Pose mCurrentPose; mCurrentPose = mDefaultPose = Pose(); // NO! ERROR mCurrentPose = Pose(); // NO mDefaultPose = Pose(); // ERROR } -- Derek Melbourne, Australia
Feb 23 2005