Changeset f2a4f6c


Ignore:
Timestamp:
Aug 26, 2016, 1:55:57 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, ctor, 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:
1e8b02f5
Parents:
4999940
Message:

fixed memory leak in lexer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/LinkageSpec.cc

    r4999940 rf2a4f6c  
    1414//
    1515
     16#include <memory>
    1617#include <string>
    1718#include <cassert>
     
    2122
    2223LinkageSpec::Spec LinkageSpec::fromString( const std::string &spec ) {
     24        std::unique_ptr<const std::string> guard(&spec);                // allocated by lexer
    2325        if ( spec == "\"Cforall\"" ) {
    2426                return Cforall;
     
    2830                throw SemanticError( "Invalid linkage specifier " + spec );
    2931        } // if
    30         delete &spec;                                                                           // allocated by lexer
    3132}
    3233
Note: See TracChangeset for help on using the changeset viewer.