+2009-05-01 Maarten Brock <sourceforge.brock AT dse.nl>
+
+ * src/SDCCast.c (processParms): fixed bug 2783061 by applying patch from
+ Keith Packard, thanks
+ * support/regression/tests/bug2783061.c: new, added
+
2009-04-27 Borut Razem <borut.razem AT siol.net>
* support/cpp/output.h, support/cpp/opts-common.c,
2009-04-01 Philipp Klaus Krause <pkk AT spth.de>
- * device/lib/z80/mul.s:
+ * device/lib/z80/mul.s:
Minor improvement in Z80 16x16 bit multiplication.
2009-03-23 Borut Razem <borut.razem AT siol.net>
ftype = (*actParm)->ftype;
+ resultType = RESULT_TYPE_NONE;
+
/* If it's a char, upcast to int. */
if (IS_INTEGRAL (ftype)
&& (getSize (ftype) < (unsigned) INTSIZE))
{
newType = newAst_LINK (copyLinkChain(ftype));
DCL_TYPE (newType->opval.lnk) = port->unqualified_pointer;
+ resultType = RESULT_TYPE_GPTR;
}
if (IS_AGGREGATE (ftype))
{
newType = newAst_LINK (copyLinkChain (ftype));
DCL_TYPE (newType->opval.lnk) = port->unqualified_pointer;
+ resultType = RESULT_TYPE_GPTR;
}
if (newType)
(*actParm)->filename = (*actParm)->right->filename;
(*actParm)->lineno = (*actParm)->right->lineno;
- decorateType (*actParm, RESULT_TYPE_NONE);
+ decorateType (*actParm, resultType);
}
return 0;
} /* vararg */
--- /dev/null
+/*
+ bug 2783061
+*/
+
+#include <stdarg.h>
+#include <testfwk.h>
+
+#define CP (void code*)0x1234
+#define XP (void xdata*)0x5678
+
+void varargs_fn(char k, ...)
+{
+ va_list arg;
+ void code * cp;
+ void xdata * xp;
+ void * gp;
+
+ va_start (arg, k);
+
+ cp = va_arg(arg, void code *);
+ ASSERT(cp == CP);
+ xp = va_arg(arg, void xdata *);
+ ASSERT(xp == XP);
+ gp = va_arg(arg, void *);
+ ASSERT(gp == (void *)CP);
+ gp = va_arg(arg, void *);
+ ASSERT(gp == (void *)XP);
+
+ va_end (arg);
+}
+
+void
+testBug(void)
+{
+ void code * cp = CP;
+ void xdata * xp = XP;
+
+ varargs_fn('k', (void code *)cp, (void xdata *)xp, cp, xp);
+}