[Issue 3495] Segfault(typinf.c) instantiating D variadic function with too few arguments
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Nov 11 07:57:23 PST 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3495
Don <clugdbug at yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
--- Comment #1 from Don <clugdbug at yahoo.com.au> 2009-11-11 07:57:22 PST ---
CAUSE: if not enough arguments, tries to create a negatively-sized type info
array!
PATCH: expression.c, line 802 (DMD2 svn 241), at end of functionArguments():
---
// If D linkage and variadic, add _arguments[] as first argument
- if (tf->linkage == LINKd && tf->varargs == 1)
+ if (tf->linkage == LINKd && tf->varargs == 1 && arguments->dim >= nparams)
{
Expression *e;
e = createTypeInfoArray(sc, (Expression **)&arguments->data[nparams],
arguments->dim - nparams);
arguments->insert(0, e);
--
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