Ignore:
Timestamp:
Jul 18, 2017, 4:40:01 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, 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.