Front-end precise: Propagate noContraction up the AST when dereferencing structs.
This should be the last commit in this sequence to form the base of the work in pull request #222.
This commit is contained in:
parent
17f0786418
commit
3c1e08057e
2 changed files with 15 additions and 11 deletions
|
|
@ -781,7 +781,7 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm
|
|||
|
||||
//
|
||||
// .length() can't be resolved until we later see the function-calling syntax.
|
||||
// Save away the name in the AST for now. Processing is compeleted in
|
||||
// Save away the name in the AST for now. Processing is completed in
|
||||
// handleLengthMethod().
|
||||
//
|
||||
if (field == "length") {
|
||||
|
|
@ -879,6 +879,10 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm
|
|||
} else
|
||||
error(loc, "does not apply to this type:", field.c_str(), base->getType().getCompleteString().c_str());
|
||||
|
||||
// Propagate noContraction up the dereference chain
|
||||
if (base->getQualifier().noContraction)
|
||||
result->getWritableType().getQualifier().noContraction = true;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue