Ignore:
Timestamp:
Nov 29, 2019, 1:47:14 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
0f9ceacb, ce7bdc4, e71c1d4
Parents:
397c101
Message:

Modified Lvalue cast handling to ignore top level dereferencing in AsmExpr?, also added test case for this fixes #152?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Lvalue.cc

    r397c101 r78cdb06  
    6060                }
    6161
    62                 struct ReferenceConversions final : public WithStmtsToAdd {
     62                struct ReferenceConversions final : public WithStmtsToAdd, public WithGuards {
    6363                        Expression * postmutate( CastExpr * castExpr );
    6464                        Expression * postmutate( AddressExpr * addrExpr );
     
    7171
    7272                struct FixIntrinsicResult final : public WithGuards {
     73                        enum {
     74                                NoSkip,
     75                                Skip,
     76                                SkipInProgress
     77                        } skip = NoSkip;
     78
     79                        void premutate( AsmExpr * ) { GuardValue( skip ); skip = Skip; }
     80                        void premutate( ApplicationExpr * ) { GuardValue( skip ); skip = (skip == Skip) ? SkipInProgress : NoSkip; }
     81
     82
    7383                        Expression * postmutate( ApplicationExpr * appExpr );
    7484                        void premutate( FunctionDecl * funcDecl );
     
    162172
    163173                Expression * FixIntrinsicResult::postmutate( ApplicationExpr * appExpr ) {
    164                         if ( isIntrinsicReference( appExpr ) ) {
     174                        if ( skip != SkipInProgress && isIntrinsicReference( appExpr ) ) {
    165175                                // eliminate reference types from intrinsic applications - now they return lvalues
    166176                                ReferenceType * result = strict_dynamic_cast< ReferenceType * >( appExpr->result );
Note: See TracChangeset for help on using the changeset viewer.