[PATCH] PR19515, driver crash while handling a clang crash

Chad Rosier mcrosier at codeaurora.org
Mon Apr 28 15:09:22 PDT 2014


LGTM.

> After a compiler crash (which prints the traceback and so forth),
> Driver::generateCompilationDiagnostics calls BuildInputs to get a
> list of inputs to pass to the preprocessor.  BuildInputs runs through
> the command-line arguments.  If the original command line included
> "-lstdc++" this was translated into "-Z-reserved-lib-stdc++" which
> is marked with options::LinkerInput, so BuildInputs includes it in
> the list of inputs (treating it kind of like an object file).
>
> generateCompilationDiagnostics then wants to filter out inputs the
> preprocessor doesn't care about.  The first thing it does is check
> for stdin, like so:
>
>   if (!strcmp(it->second->getValue(), "-"))
>
> Sadly, "-Z-reserved-lib-stdc++" is Value-less.  The Values are a
> SmallVector, which in this case is empty, so attempting to retrieve
> one goes boom.
>
> There's another test immediately afterward, which is
>
>   if (types::getPreprocessedType(it->first) == types::TY_INVALID)
>
> and swapping the order of those tests makes the problem go away.
> --paulr
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation




More information about the cfe-commits mailing list