Ignore:
Timestamp:
Dec 2, 2020, 12:11:01 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
833ba13, f0d67e5
Parents:
2b2f59d (diff), 4a8f150 (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.
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInitNew.cpp

    r2b2f59d ra25f64b  
    413413        void SelfAssignChecker::previsit( const ast::ApplicationExpr * appExpr ) {
    414414                auto function = getFunction( appExpr );
    415                 if ( function->name == "?=?" ) { // doesn't use isAssignment, because ?+=?, etc. should not count as self-assignment
    416                         if ( appExpr->args.size() == 2 ) {
    417                                 // check for structural similarity (same variable use, ignore casts, etc. - but does not look too deeply, anything looking like a function is off limits)
    418                                 if ( structurallySimilar( appExpr->args.front(), appExpr->args.back() ) ) {
    419                                         SemanticWarning( appExpr->location, Warning::SelfAssignment, toCString( appExpr->args.front() ) );
    420                                 }
    421                         }
     415                // Doesn't use isAssignment, because ?+=?, etc. should not count as self-assignment.
     416                if ( function->name == "?=?" && appExpr->args.size() == 2
     417                                // Check for structural similarity (same variable use, ignore casts, etc.
     418                                // (but does not look too deeply, anything looking like a function is off limits).
     419                                && structurallySimilar( appExpr->args.front(), appExpr->args.back() ) ) {
     420                        SemanticWarning( appExpr->location, Warning::SelfAssignment, toCString( appExpr->args.front() ) );
    422421                }
    423422        }
Note: See TracChangeset for help on using the changeset viewer.