Merge pull request #1703 from dj2/mem_leak

Allocate empty function name in the string pool.
This commit is contained in:
John Kessenich 2019-02-21 13:10:18 +07:00 committed by GitHub
commit 17a8d9ad00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -473,8 +473,8 @@ function_identifier
if ($$.function == 0) {
// error recover
TString empty("");
$$.function = new TFunction(&empty, TType(EbtVoid), EOpNull);
TString* empty = NewPoolTString("");
$$.function = new TFunction(empty, TType(EbtVoid), EOpNull);
}
}
| non_uniform_qualifier {

View File

@ -4447,8 +4447,8 @@ yyreduce:
if ((yyval.interm).function == 0) {
// error recover
TString empty("");
(yyval.interm).function = new TFunction(&empty, TType(EbtVoid), EOpNull);
TString* empty = NewPoolTString("");
(yyval.interm).function = new TFunction(empty, TType(EbtVoid), EOpNull);
}
}
#line 4455 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */