From 96138992ac98f8962dc2345d9ba3e99006af80b2 Mon Sep 17 00:00:00 2001 From: Jack Palevich Date: Fri, 31 Jul 2009 15:58:19 -0700 Subject: Fix parsing of function declarations that return pointers. Check that = only evaluates the left-hand-side once. --- libacc/acc.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'libacc/acc.cpp') diff --git a/libacc/acc.cpp b/libacc/acc.cpp index f70c7a13..676947e2 100644 --- a/libacc/acc.cpp +++ b/libacc/acc.cpp @@ -4409,15 +4409,11 @@ class Compiler : public ErrorSink { Type* acceptDecl2(Type* pType, tokenid_t& declName, bool nameAllowed, bool nameRequired, bool& reportFailure) { - int ptrCounter = 0; while (accept('*')) { - ptrCounter++; + pType = createType(TY_POINTER, pType, NULL); } pType = acceptDecl3(pType, declName, nameAllowed, nameRequired, reportFailure); - while (ptrCounter-- > 0) { - pType = createType(TY_POINTER, pType, NULL); - } return pType; } -- cgit v1.2.3