Hash :
f51fdd2e
Author :
Date :
2016-10-03T10:03:40
Ensure that all functions have a body node in the AST Some traversers that insert code to main() assume that the main() function has a non-null body node in place. This assumption was previously wrong, since functions could be missing the body node in case the function body was empty. Fix possible invalid dereferencing of missing function body nodes by always adding an empty sequence node to represent the body of functions that have an empty body in the ESSL source. This also enables simplifying some tree traversers that used to take the possibility of missing function body nodes into account. Also fix AddDefaultReturnStatements to check the last statement inside the function body for a return statement, instead of checking the first statement. BUG=angleproject:1539 TEST=angle_unittests, angle_end2end_tests Change-Id: I2fbd18c78653fa2f1a96dbd9a619accc4874030d Reviewed-on: https://chromium-review.googlesource.com/392046 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>