Ignore:
Timestamp:
Feb 23, 2024, 11:41:10 PM (3 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
0a9b5c1, 1e93617
Parents:
3d5a8cb (diff), 1761046 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Peter A. Buhr <pabuhr@…> (02/23/24 18:54:24)
git-committer:
Peter A. Buhr <pabuhr@…> (02/23/24 23:41:10)
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CandidateFinder.cpp

    r3d5a8cb r46aa60e  
    15121512        void Finder::postvisit( const ast::ConditionalExpr * conditionalExpr ) {
    15131513                // candidates for condition
     1514                ast::ptr<ast::Expr> arg1 = notZeroExpr( conditionalExpr->arg1 );
    15141515                CandidateFinder finder1( context, tenv );
    1515                 ast::ptr<ast::Expr> arg1 = notZeroExpr( conditionalExpr->arg1 );
    15161516                finder1.find( arg1, ResolveMode::withAdjustment() );
    15171517                if ( finder1.candidates.empty() ) return;
    15181518
    15191519                // candidates for true result
     1520                // FIX ME: resolves and runs arg1 twice when arg2 is missing.
     1521                ast::Expr const * arg2 = conditionalExpr->arg2;
     1522                arg2 = arg2 ? arg2 : conditionalExpr->arg1.get();
    15201523                CandidateFinder finder2( context, tenv );
    15211524                finder2.allowVoid = true;
    1522                 finder2.find( conditionalExpr->arg2, ResolveMode::withAdjustment() );
     1525                finder2.find( arg2, ResolveMode::withAdjustment() );
    15231526                if ( finder2.candidates.empty() ) return;
    15241527
Note: See TracChangeset for help on using the changeset viewer.