Changeset 066d77a for src


Ignore:
Timestamp:
Nov 8, 2016, 4:08:36 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:
b6fd751
Parents:
3f0c6a5
Message:

documentation for an assertion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r3f0c6a5 r066d77a  
    307307                                                } else {
    308308                                                        // no address-of operator, so must be a pointer - add dereference
     309                                                        // NOTE: if the assertion starts to trigger, check that the application expr isn't being shared.
     310                                                        // Since its arguments are modified here, this assertion most commonly triggers when the application
     311                                                        // is visited multiple times.
    309312                                                        UntypedExpr * newExpr = new UntypedExpr( new NameExpr( "*?" ) );
    310313                                                        newExpr->get_args().push_back( *arg );
    311314                                                        Type * type = InitTweak::getPointerBase( (*arg)->get_result() );
    312                                                         assert( type );
     315                                                        assertf( type, "First argument to a derefence must be a pointer. Ensure that expressions are not being shared." );
    313316                                                        newExpr->set_result( type->clone() );
    314317                                                        *arg = newExpr;
Note: See TracChangeset for help on using the changeset viewer.