<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 - Typo + missing function parameters = crash"
   href="https://bugs.llvm.org/show_bug.cgi?id=40286">40286</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Typo + missing function parameters = crash
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </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>Keywords</th>
          <td>crash-on-invalid
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>release blocker
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Driver
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>husseydevin@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>husseydevin@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=21312" name="attach_21312" title="crash dump">attachment 21312</a> <a href="attachment.cgi?id=21312&action=edit" title="crash dump">[details]</a></span>
crash dump

When a function call has both a missing parameter and a typo in one of the
parameters that Clang recognizes, Clang trunk (r350783 - r350877 at least)
crashes. Clang 7.0 is not affected.

This isn't a platform-specific issue, it currently occurs on the Linux-based
Compiler Explorer as seen here: <a href="https://godbolt.org/z/ngCmP_">https://godbolt.org/z/ngCmP_</a>

Arguments:
clang -fsyntax-only test5.c

int foo(int x, int y);
int bar(int value) {
    return foo(valie);
}

Notice the typo in "valie" and the missing parameter. 

----

Preprocessed source isn't really necessary, but here it is:

# 1 "<built-in>"
# 1 "/Users/user/test5.c"
int foo(int x, int y);
int bar(int value) {
    return foo(valie);
}

----

shell script:

# Crash reproducer for clang version 8.0.0 (trunk 350877)
# Driver args: "-fsyntax-only" "/Users/user/test5.c"
# Original command:  "/Users/user/llvm/llvm/build/bin/clang-8" "-cc1" "-triple"
"x86_64-apple-macosx10.14.0" "-Wdeprecated-objc-isa-usage"
"-Werror=deprecated-objc-isa-usage" "-fsyntax-only" "-disable-free"
"-main-file-name" "test5.c" "-mrelocation-model" "pic" "-pic-level" "2"
"-mthread-model" "posix" "-mdisable-fp-elim" "-masm-verbose" "-munwind-tables"
"-target-cpu" "penryn" "-dwarf-column-info" "-debugger-tuning=lldb"
"-ggnu-pubnames" "-target-linker-version" "409.12" "-resource-dir"
"/Users/user/llvm/llvm/build/lib/clang/8.0.0"
"-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include"
"-I/usr/local/include" "-fdebug-compilation-dir" "/Users/user/llvm/llvm/build"
"-ferror-limit" "19" "-fmessage-length" "238" "-stack-protector" "1" "-fblocks"
"-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit"
"-fobjc-runtime=macosx-10.14.0" "-fmax-type-align=16"
"-fdiagnostics-show-option" "-fcolor-diagnostics" "-x" "c"
"/Users/user/test5.c"
 "/Users/user/llvm/llvm/build/bin/clang-8" "-cc1" "-triple"
"x86_64-apple-macosx10.14.0" "-Wdeprecated-objc-isa-usage"
"-Werror=deprecated-objc-isa-usage" "-fsyntax-only" "-disable-free"
"-main-file-name" "test5.c" "-mrelocation-model" "pic" "-pic-level" "2"
"-mthread-model" "posix" "-mdisable-fp-elim" "-masm-verbose" "-munwind-tables"
"-target-cpu" "penryn" "-dwarf-column-info" "-debugger-tuning=lldb"
"-ggnu-pubnames" "-target-linker-version" "409.12" "-ferror-limit" "19"
"-fmessage-length" "238" "-stack-protector" "1" "-fblocks"
"-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit"
"-fobjc-runtime=macosx-10.14.0" "-fmax-type-align=16"
"-fdiagnostics-show-option" "-fcolor-diagnostics" "-x" "c" "test5-49dc52.c"

------

Crash dump is attached.

------

macOS 10.14.2 (Mojave Patcher)
MacBook Pro (15-inch, Early 2011) / MacBookPro8,2
Intel Core i7 (2nd Generation/Sandy Bridge) @ 4 cores, 2.0 GHz
8 GB RAM
LLVM and Clang built from source, CMAKE_C{XX}_FLAGS="-O0 -g",
CMAKE_BUILD_TYPE="Debug", LLVM_TARGETS_TO_BUILD="X86;ARM"
Compiled with Apple LLVM version 10.0.0 (clang-1000.11.45.5)</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>