<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - After 6d485ff455ea, Assertion failed: (i < getNumParams() && "Illegal param #"), function getParamDecl, file clang/include/clang/AST/Decl.h, line 2430."
   href="https://bugs.llvm.org/show_bug.cgi?id=47347">47347</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>After 6d485ff455ea, Assertion failed: (i < getNumParams() && "Illegal param #"), function getParamDecl, file clang/include/clang/AST/Decl.h, line 2430.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dimitry@andric.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Bulding the FreeBSD graphics/pgplot results in an assertion:

./pgdispd/updatelgtitle.c:31:8: note: 'sprintf' is a builtin with type 'int
(char *, const char *, ...)'
Assertion failed: (i < getNumParams() && "Illegal param #"), function
getParamDecl, file
/usr/local/poudriere/jails/head-i386/usr/src/contrib/llvm-project/clang/include/clang/AST/Decl.h,
line 2430.
PLEASE submit a bug report to <a href="https://bugs.freebsd.org/submit/">https://bugs.freebsd.org/submit/</a> and include the
crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: cc -O2 -pipe -fstack-protector-strong
-fno-strict-aliasing -I/usr/local/include -DPGDISP -c ./pgdispd/updatelgtitle.c
-o updatelgtitle.o 
1.      ./pgdispd/updatelgtitle.c:62:8: current parser token ')'
2.      ./pgdispd/updatelgtitle.c:21:1: parsing function body 'updatelgtitle'
3.      ./pgdispd/updatelgtitle.c:21:1: in compound statement ('{}')
4.      ./pgdispd/updatelgtitle.c:37:7: in compound statement ('{}')

Bisection shows this to be caused by <a href="https://reviews.llvm.org/D71566">https://reviews.llvm.org/D71566</a> /
<a href="https://reviews.llvm.org/rG6d485ff455ea">https://reviews.llvm.org/rG6d485ff455ea</a> ("Improve static checks for sprintf and
__builtin___sprintf_chk").

Minimized test case:

// clang -cc1 -triple x86_64-- -S updatelgtitle-min.c
int a;
char b;
double c, d;
void e() {
  void sprintf();
  sprintf(b, "line graphics #%d X %.6g Y %.6g", a, c, d);
}</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>