Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: src/sksl/SkSLParser.cpp

Issue 2119903002: fixed SkSL memory leak (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "stdio.h" 8 #include "stdio.h"
9 #include "SkSLParser.h" 9 #include "SkSLParser.h"
10 #include "SkSLToken.h" 10 #include "SkSLToken.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 skslset_lineno(1, fScanner); 63 skslset_lineno(1, fScanner);
64 64
65 if (false) { 65 if (false) {
66 // avoid unused warning 66 // avoid unused warning
67 yyunput(0, nullptr, fScanner); 67 yyunput(0, nullptr, fScanner);
68 } 68 }
69 } 69 }
70 70
71 Parser::~Parser() { 71 Parser::~Parser() {
72 sksl_delete_buffer(fBuffer, fScanner); 72 sksl_delete_buffer(fBuffer, fScanner);
73 sksllex_destroy(fScanner);
73 } 74 }
74 75
75 /* (precision | directive | declaration)* END_OF_FILE */ 76 /* (precision | directive | declaration)* END_OF_FILE */
76 std::vector<std::unique_ptr<ASTDeclaration>> Parser::file() { 77 std::vector<std::unique_ptr<ASTDeclaration>> Parser::file() {
77 std::vector<std::unique_ptr<ASTDeclaration>> result; 78 std::vector<std::unique_ptr<ASTDeclaration>> result;
78 for (;;) { 79 for (;;) {
79 switch (this->peek().fKind) { 80 switch (this->peek().fKind) {
80 case Token::END_OF_FILE: 81 case Token::END_OF_FILE:
81 return result; 82 return result;
82 case Token::PRECISION: 83 case Token::PRECISION:
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 bool Parser::identifier(std::string* dest) { 1381 bool Parser::identifier(std::string* dest) {
1381 Token t; 1382 Token t;
1382 if (this->expect(Token::IDENTIFIER, "identifier", &t)) { 1383 if (this->expect(Token::IDENTIFIER, "identifier", &t)) {
1383 *dest = t.fText; 1384 *dest = t.fText;
1384 return true; 1385 return true;
1385 } 1386 }
1386 return false; 1387 return false;
1387 } 1388 }
1388 1389
1389 } // namespace 1390 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698