Fixed: don't recurse into function bodies when calculating maximum local counts.

This commit is contained in:
arookas 2015-12-21 04:57:00 -05:00
parent 694210cd5a
commit 44eab8e9e6

View file

@ -53,7 +53,7 @@ namespace arookas
{
locals += child.MaxLocalCount; // HACK: compound statements aren't their own scope
}
else
else if (!(child is sunFunctionDefinition)) // don't recurse into function bodies
{
int childLocals = child.MaxLocalCount;
if (childLocals > maxChildLocals)