D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20212 - invalid debug info with enum type in library
Summary: invalid debug info with enum type in library
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All Windows
: P1 regression
Assignee: No Owner
URL:
Keywords: DebugInfo, pull
Depends on:
Blocks:
 
Reported: 2019-09-13 17:38 UTC by Rainer Schuetze
Modified: 2019-09-13 23:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Rainer Schuetze 2019-09-13 17:38:12 UTC
On git master, consider three modules:

///////////////////////////////////
module system;

enum Endian
{
	bigEndian,   /// Big endian byte order
	littleEndian /// Little endian byte order
}

/// The endianness that the program was compiled for.
Endian endian = Endian.littleEndian;

///////////////////////////////////
module registry;
import system;

void _RVT_from_Endian(Endian endian) {}

///////////////////////////////////
module main;
import system, registry;

void main()
{
	_RVT_from_Endian(Endian.littleEndian);
}

///////////////////////////////////

Build a library with

   dmd -lib -ofreg.lib -g -m64 system.d registry.d

and link with main:

   dmd main.d -m64 -g reg.lib

reg.lib(registry_2_61c.obj) : fatal error LNK1103: debugging information corrupt; recompile module
Comment 1 Dlang Bot 2019-09-13 17:46:29 UTC
@rainers created dlang/dmd pull request #10407 "fix issue 20212 - invalid debug info with enum type in library" fixing this issue:

- fix issue 20212 - invalid debug info with enum type in library
  
  reusing an old type index does not work because it might be in a different object file. Let cv_debtyp() sort out duplicates instead.

https://github.com/dlang/dmd/pull/10407
Comment 2 Rainer Schuetze 2019-09-13 17:49:06 UTC
regression introduced by https://github.com/dlang/dmd/pull/10328
Comment 3 Dlang Bot 2019-09-13 23:06:58 UTC
dlang/dmd pull request #10407 "fix issue 20212 - invalid debug info with enum type in library" was merged into master:

- 385d172caec72f2a2610e48df9c3358e7266a5dc by Rainer Schuetze:
  fix issue 20212 - invalid debug info with enum type in library
  
  reusing an old type index does not work because it might be in a different object file. Let cv_debtyp() sort out duplicates instead.

https://github.com/dlang/dmd/pull/10407