Changeset 870d1f0


Ignore:
Timestamp:
Jul 18, 2017, 4:40:01 PM (4 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
d1685588
Parents:
4fbdfae0
Message:

Update concurrency keywords pass for references

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Keywords.cc

    r4fbdfae0 r870d1f0  
    447447                //Makes sure it's not a copy
    448448                PointerType* pty = dynamic_cast< PointerType * >( ty );
    449                 if( ! pty ) throw SemanticError( "Mutex argument must be of pointer/reference type ", arg );
     449                ReferenceType* rty = dynamic_cast< ReferenceType * >( ty );
     450                if( ! pty && ! rty ) throw SemanticError( "Mutex argument must be of pointer/reference type ", arg );
    450451
    451452                //Make sure the we are pointing directly to a type
    452                 Type* base = pty->get_base();
     453                Type* base = pty ? pty->get_base() : rty->get_base();
    453454                if(  dynamic_cast< PointerType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg );
    454455
Note: See TracChangeset for help on using the changeset viewer.