Commit e06002a4 by Alok Priyadarshi

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=459 R=kbr@chromium.org Review URL: https://codereview.appspot.com/12891043
parent feaaae28
...@@ -1429,11 +1429,13 @@ bool TParseContext::structNestingErrorCheck(const TSourceLoc& line, const TField ...@@ -1429,11 +1429,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.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