[Issue 3306] bad function/delegate literal generated into header files
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Sep 7 23:46:42 PDT 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3306
Rainer Schuetze <r.sagitario at gmx.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch, wrong-code
--- Comment #1 from Rainer Schuetze <r.sagitario at gmx.de> 2009-09-07 23:46:41 PDT ---
Here is the patch that fixes the problem, but I have no idea why it was
implemented the way it was before. There might be other places that may need
the original implementation.
--- func.c (revision 196)
+++ func.c (working copy)
@@ -2426,15 +2426,9 @@
void FuncLiteralDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
{
- static Identifier *idfunc;
- static Identifier *iddel;
-
- if (!idfunc)
- idfunc = new Identifier("function", 0);
- if (!iddel)
- iddel = new Identifier("delegate", 0);
-
- type->toCBuffer(buf, ((tok == TOKdelegate) ? iddel : idfunc), hgs);
+ buf->writestring(kind());
+ buf->writeByte(' ');
+ type->toCBuffer(buf, NULL, hgs);
bodyToCBuffer(buf, hgs);
}
--
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