Ignore:
Timestamp:
Dec 5, 2019, 5:49:23 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
924c5ce
Parents:
1805b1b
Message:

Implemented Keyword cast in the alternative finder to remove aliassing problems

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Keywords.cc

    r1805b1b r3b0c8cb  
    309309                        if( !type_decl ) SemanticError( cast, context_error );
    310310                        if( !dtor_decl ) SemanticError( cast, context_error );
    311                         Expression * arg = cast->arg;
    312                         cast->arg = nullptr;
    313                         delete cast;
    314                         return new CastExpr(
    315                                 UntypedExpr::createDeref(
    316                                         new UntypedExpr( new NameExpr( getter_name ), { arg } )
    317                                 ),
    318                                 new ReferenceType(
    319                                         noQualifiers,
    320                                         new StructInstType( noQualifiers, type_decl ) )
    321                                 );
     311                        assert( cast->result == nullptr );
     312                        cast->set_result( new ReferenceType( noQualifiers, new StructInstType( noQualifiers, type_decl ) ) );
     313                        cast->concrete_target.field  = field_name;
     314                        cast->concrete_target.getter = getter_name;
    322315                }
    323316                return cast;
Note: See TracChangeset for help on using the changeset viewer.