[Issue 10833] DMD puts mixin's source code in the binary

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 19 12:58:16 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10833


hsteoh at quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh at quickfur.ath.cx


--- Comment #6 from hsteoh at quickfur.ath.cx 2013-08-19 12:58:15 PDT ---
IMO DMD should somehow keep track of which template instantiations actually
require code to be emitted. If a template function only runs in CTFE but not at
runtime, that code shouldn't even be emitted in the first place.

Tho I understand that separate compilation may make this tricky. :)

One possible approach is to emit all template instantiations in a separate
static library that the linker can then selectively pull from. Linkers are
designed to only pull parts of the library that are actually referenced, so
this won't require massive compiler changes. Then we can both reduce template
bloat and avoid security issues like this one.

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


More information about the Digitalmars-d-bugs mailing list