From: Chris Lattner Date: Fri, 19 Mar 2004 23:34:33 +0000 (+0000) Subject: Hrm, we were leaking ~1M of garbage that valgrind never told us about because X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e1512592885b0286f28ff51ad462df46e1837a47;p=oota-llvm.git Hrm, we were leaking ~1M of garbage that valgrind never told us about because it was "reachable". Cute. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12515 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AsmParser/Lexer.l b/lib/AsmParser/Lexer.l index c2db5a26348..3203fe5b518 100644 --- a/lib/AsmParser/Lexer.l +++ b/lib/AsmParser/Lexer.l @@ -306,6 +306,14 @@ getelementptr { RET_TOK(MemOpVal, GetElementPtr, GETELEMENTPTR); } {FPConstant} { llvmAsmlval.FPVal = atof(yytext); return FPVAL; } {HexFPConstant} { llvmAsmlval.FPVal = HexToFP(yytext); return FPVAL; } +<> { + /* Make sure to free the internal buffers for flex when we are + * done reading our input! + */ + yy_delete_buffer(YY_CURRENT_BUFFER); + return EOF; + } + [ \t\n] { /* Ignore whitespace */ } . { return yytext[0]; }