[LLVMbugs] [Bug 19607] New: Undiagnosed implementation limit of 127 nested function prototypes

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Apr 29 10:38:07 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19607

            Bug ID: 19607
           Summary: Undiagnosed implementation limit of 127 nested
                    function prototypes
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rnk at google.com
                CC: david.majnemer at gmail.com, llvmbugs at cs.uiuc.edu,
                    rjmccall at apple.com
    Classification: Unclassified

ParmVarDecl::setScopeInfo() is defined like so:

  void setScopeInfo(unsigned scopeDepth, unsigned parameterIndex) {
    assert(!ParmVarDeclBits.IsObjCMethodParam);
    ParmVarDeclBits.ScopeDepthOrObjCQuals = scopeDepth;
    assert(ParmVarDeclBits.ScopeDepthOrObjCQuals == scopeDepth
           && "truncation!");
    setParameterIndex(parameterIndex);
  }

It's possible to construct a program that trips this assertion by creating a
deeply nested function prototype:

void foo(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void
(*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void
(*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void
(*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void
(*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void
(*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void
(*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void
(*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void
(*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void
(*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void
(*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void
(*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void
(*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void
(*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void
(*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void
(*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void (*f)(void
(*f)(void (*f)(void (*f)(void
(*f)()))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))));

Assertion failed: ParmVarDeclBits.ScopeDepthOrObjCQuals == scopeDepth &&
"truncation!", file ..\tools\clang\include\clang/AST/Decl.h, line 1276

I wanted one more bit in VarDeclBits.TSCSpec, so I considered taking it from
here.  However, I discovered we don't enforce an upper bound on this quantity.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140429/7e7a5c72/attachment.html>


More information about the llvm-bugs mailing list