Fix preprocessor memory leak.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22195 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-06-26 23:41:30 +00:00
parent db4cd54dac
commit 554c854143

View File

@ -1032,24 +1032,26 @@ int MacroExpand(int atom, yystypepp* yylvalpp, int expandUndef)
return 1;
}
// no recursive expansions
if (sym && sym->details.mac.busy)
return 0; // no recursive expansions
return 0;
// not expanding of undefined symbols
if ((! sym || sym->details.mac.undef) && ! expandUndef)
return 0;
in = (MacroInputSrc*)malloc(sizeof(*in));
memset(in, 0, sizeof(*in));
in->base.line = cpp->currentInput->line;
in->base.name = cpp->currentInput->name;
if ((! sym || sym->details.mac.undef)) {
if (expandUndef) {
// push input
in->base.scan = zero_scan;
in->base.prev = cpp->currentInput;
cpp->currentInput = &in->base;
if ((! sym || sym->details.mac.undef) && expandUndef) {
// push input
in->base.scan = zero_scan;
in->base.prev = cpp->currentInput;
cpp->currentInput = &in->base;
return -1;
} else
return 0;
return -1;
}
in->base.scan = macro_scan;