Allocate empty function name in the string pool.
Inside the grammar for function_identifier if the .function is null an empty function name is allocated. This is allocated on the stack and passed into TFunction as a pointer. TFunction just stores that pointer. Later, when we access the name we will receive an invalid usage of a stack allocated variable. This CL switches to using NewPoolTStringn for the empty function name.
This commit is contained in:
parent
58d6905ea0
commit
756bfd0ad1
@ -473,8 +473,8 @@ function_identifier
|
|||||||
|
|
||||||
if ($$.function == 0) {
|
if ($$.function == 0) {
|
||||||
// error recover
|
// error recover
|
||||||
TString empty("");
|
TString* empty = NewPoolTString("");
|
||||||
$$.function = new TFunction(&empty, TType(EbtVoid), EOpNull);
|
$$.function = new TFunction(empty, TType(EbtVoid), EOpNull);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
| non_uniform_qualifier {
|
| non_uniform_qualifier {
|
||||||
|
|||||||
@ -4447,8 +4447,8 @@ yyreduce:
|
|||||||
|
|
||||||
if ((yyval.interm).function == 0) {
|
if ((yyval.interm).function == 0) {
|
||||||
// error recover
|
// error recover
|
||||||
TString empty("");
|
TString* empty = NewPoolTString("");
|
||||||
(yyval.interm).function = new TFunction(&empty, TType(EbtVoid), EOpNull);
|
(yyval.interm).function = new TFunction(empty, TType(EbtVoid), EOpNull);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#line 4455 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
|
#line 4455 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user