From a38f33ebea19e30a1adc71fb457b4002c4c3c787 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 29 Apr 2009 08:06:31 -0700 Subject: [PATCH] Promote varargs pointers to RESULT_TYPE_GPTR The addition of the RESULT_TYPE_GPTR as distinct from RESULT_TYPE_NONE was not propogated into the varargs function parameter handling code resulting in non-generic pointers being passed to varargs functions. --- src/SDCCast.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/SDCCast.c b/src/SDCCast.c index 39140831..0ec893b3 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -863,6 +863,8 @@ processParms (ast *func, ftype = (*actParm)->ftype; + resultType = RESULT_TYPE_NONE; + /* If it's a char, upcast to int. */ if (IS_INTEGRAL (ftype) && (getSize (ftype) < (unsigned) INTSIZE)) @@ -874,12 +876,14 @@ processParms (ast *func, { 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) @@ -890,7 +894,7 @@ processParms (ast *func, (*actParm)->filename = (*actParm)->right->filename; (*actParm)->lineno = (*actParm)->right->lineno; - decorateType (*actParm, RESULT_TYPE_NONE); + decorateType (*actParm, resultType); } return 0; } /* vararg */ -- 2.30.2