[cfe-dev] Missing ReturnStmt?

Dmitri Gribenko gribozavr at gmail.com
Mon Feb 6 07:00:27 PST 2012


2012/2/6 Zong <zong_y365 at 163.com>:
> Why can't I observe a "ReturnStmt"?
> If I change "*c=b" with something other (e.g., b=c), then "ReturnStmt"
> appears.  I just can! 't figure out the reason. Would someone please help me
> ? Thanks!

I suspect that this happens because checkers are not run on the Decl
if an error has occurred. In
lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:

void AnalysisConsumer::HandleCode(Decl *D) {

  // Don't run the actions if an error has occurred with parsing the file.
  DiagnosticsEngine &Diags = PP.getDiagnostics();
  if (Diags.hasErrorOccurred() || Diags.hasFatalErrorOccurred())
    return;

Dmitri Gribenko

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/




More information about the cfe-dev mailing list