Changeset db4977a for src/ResolvExpr


Ignore:
Timestamp:
Aug 10, 2015, 4:46:08 PM (9 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
99f4165
Parents:
8c84ebd
Message:

Fix so void* does not have common type with function pointer

Location:
src/ResolvExpr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CommonType.cc

    r8c84ebd rdb4977a  
    138138        void CommonType::visit( PointerType *pointerType ) {
    139139                if ( PointerType *otherPointer = dynamic_cast< PointerType* >( type2 ) ) {
    140                         if ( widenFirst && dynamic_cast< VoidType* >( otherPointer->get_base() ) ) {
     140                        if ( widenFirst && dynamic_cast< VoidType* >( otherPointer->get_base() ) && ! isFtype(pointerType->get_base(), indexer) ) {
    141141                                result = otherPointer->clone();
    142142                                result->get_qualifiers() += pointerType->get_qualifiers();
    143                         } else if ( widenSecond && dynamic_cast< VoidType* >( pointerType->get_base() ) ) {
     143                        } else if ( widenSecond && dynamic_cast< VoidType* >( pointerType->get_base() ) && ! isFtype(otherPointer->get_base(), indexer) ) {
    144144                                result = pointerType->clone();
    145145                                result->get_qualifiers() += otherPointer->get_qualifiers();
  • src/ResolvExpr/typeops.h

    r8c84ebd rdb4977a  
    117117
    118118        // in Unify.cc
     119        bool isFtype( Type *type, const SymTab::Indexer &indexer );
    119120        bool typesCompatible( Type *, Type *, const SymTab::Indexer &indexer, const TypeEnvironment &env );
    120121        bool typesCompatibleIgnoreQualifiers( Type *, Type *, const SymTab::Indexer &indexer, const TypeEnvironment &env );
Note: See TracChangeset for help on using the changeset viewer.