Ignore:
Timestamp:
Oct 17, 2018, 4:16:18 PM (3 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer
Children:
fbecee5
Parents:
da48183
Message:

Fix memory bugs in deferred resolution

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/ResolveAssertions.cc

    rda48183 r2c187378  
    166166
    167167                Expression* varExpr = match.cdata.combine( alt.cvtCost );
    168                 varExpr->result = match.adjType;
     168                delete varExpr->result;
     169                varExpr->result = match.adjType->clone();
    169170
    170171                // follow the current assertion's ID chain to find the correct set of inferred parameters
     
    177178
    178179                (*inferParams)[ decl->get_uniqueId() ] = ParamEntry{
    179                                 candidate->get_uniqueId(), match.adjType, decl->get_type(), varExpr };
     180                                candidate->get_uniqueId(), match.adjType, decl->get_type()->clone(), varExpr };
    180181        }
    181182
     
    215216                                matches.emplace_back( cdata, adjType, std::move(newEnv), std::move(have),
    216217                                        std::move(newNeed), std::move(newOpenVars) );
     218                        } else {
     219                                delete adjType;
    217220                        }
    218221                }
Note: See TracChangeset for help on using the changeset viewer.