Thread overview
error in /ztc/elfobj.c 1251
Dec 09, 2004
Ben Hinkle
Dec 09, 2004
Ben Hinkle
Dec 09, 2004
Thomas Kuehne
Dec 09, 2004
Thomas Kuehne
December 09, 2004
Compiling

bool foo() {
  int x;
  for (;;) {
    if (x == 0)
      return true;
    x = 1;
  }
  return false;
}

int main() {
  foo();
  return 0;
}

[locks]$ dmd -g test.d
Internal error: ../ztc/elfobj.c 1251

A related issue reported by Jan Bendtsen on the main newsgroup had a workaround so I'll probably be able to work around it but currently it means the Locks library doesn't compile. Glancing over the code it uses early returns pretty often so hopefully the workaround will be small.

-Ben
December 09, 2004
I should say it only happens on linux (hence the elf, I suppose). Windows
compiles Locks just fine.
December 09, 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Added to DStress as http://svn.kuehne.cn/dstress/run/bug_elfobj_1251_A.d http://svn.kuehne.cn/dstress/run/bug_elfobj_1251_B.d

Thomas

Ben Hinkle schrieb am Wed, 08 Dec 2004 19:35:43 -0500:
> Compiling
>
> bool foo() {
>   int x;
>   for (;;) {
>     if (x == 0)
>       return true;
>     x = 1;
>   }
>   return false;
> }
>
> int main() {
>   foo();
>   return 0;
> }
>
> [locks]$ dmd -g test.d
> Internal error: ../ztc/elfobj.c 1251

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.9.13 (GNU/Linux)

iD8DBQFBt8bn3w+/yD4P9tIRAr0jAKCZgj6ggEszNZqEVQ1zZOHEXEHKpACgunVD
Neqea07++Zdv34ey0zUzT+A=
=+vpg
-----END PGP SIGNATURE-----
December 09, 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thomas Kuehne schrieb am Thu, 9 Dec 2004 04:30:47 +0100:
> Ben Hinkle schrieb am Wed, 08 Dec 2004 19:35:43 -0500:
>> bool foo() {
>>   int x;
>>   for (;;) {
>>     if (x == 0)
>>       return true;
>>     x = 1;
>>   }
>>   return false;
>> }
>>
>> int main() {
>>   foo();
>>   return 0;
>> }
>>
>> [locks]$ dmd -g test.d
>> Internal error: ../ztc/elfobj.c 1251

It's a regression between dmd-0.102 and dmd-0.104.

Thomas


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.9.13 (GNU/Linux)

iD8DBQFBt8gq3w+/yD4P9tIRAmeNAKChNp6LicTriS89JtAQR+Ewchqr6gCfbwTs
49uEjgXeTiSBvO2dxaBHCl4=
=D3qX
-----END PGP SIGNATURE-----