Commit 41a49272 by Jamie Madill

Fixed error message for exceeding maximum struct nesting.

It got broken in r2423. We were referring to field-name as struct-name. This patch fixes the regression and also improves the error message by adding the field-name. BUG=angle:459 R=kbr@chromium.org Review URL: https://codereview.appspot.com/12891043 Change-Id: I9ac9a8dafcad1857f7d39e6d494e457d1fc50f70 Reviewed-on: https://chromium-review.googlesource.com/190530Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org> Reviewed-by: 's avatarNicolas Capens <nicolascapens@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 1e40d1c9
...@@ -2040,11 +2040,13 @@ bool TParseContext::structNestingErrorCheck(const TSourceLoc& line, const TField ...@@ -2040,11 +2040,13 @@ bool TParseContext::structNestingErrorCheck(const TSourceLoc& line, const TField
// We're already inside a structure definition at this point, so add // We're already inside a structure definition at this point, so add
// one to the field's struct nesting. // one to the field's struct nesting.
if (1 + field.type()->getDeepestStructNesting() > kWebGLMaxStructNesting) { if (1 + field.type()->getDeepestStructNesting() > kWebGLMaxStructNesting) {
std::stringstream extraInfoStream; std::stringstream reasonStream;
extraInfoStream << "Reference of struct type " << field.type()->getStruct()->name() reasonStream << "Reference of struct type "
<< " exceeds maximum struct nesting of " << kWebGLMaxStructNesting; << field.type()->getStruct()->name().c_str()
std::string extraInfo = extraInfoStream.str(); << " exceeds maximum allowed nesting level of "
error(line, "", "", extraInfo.c_str()); << kWebGLMaxStructNesting;
std::string reason = reasonStream.str();
error(line, reason.c_str(), field.name().c_str(), "");
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment