Commit 6a25746c by jchen10 Committed by Commit Bot

Generate uniqueId for all TStructure

If not present, ASSERT error may happen in debug build. BUG=chromium:643075 Change-Id: Ia57e3771ab4d2861aefc04287fbbce85232f1f4d Reviewed-on: https://chromium-review.googlesource.com/381315 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent dea2777c
......@@ -3259,7 +3259,6 @@ TTypeSpecifierNonArray TParseContext::addStructure(const TSourceLoc &structLine,
// Store a bool in the struct if we're at global scope, to allow us to
// skip the local struct scoping workaround in HLSL.
structure->setUniqueId(TSymbolTable::nextUniqueId());
structure->setAtGlobalScope(symbolTable.atGlobalLevel());
if (!structName->empty())
......
......@@ -11,6 +11,7 @@
#include "compiler/translator/Types.h"
#include "compiler/translator/InfoSink.h"
#include "compiler/translator/IntermNode.h"
#include "compiler/translator/SymbolTable.h"
#include <algorithm>
#include <climits>
......@@ -336,6 +337,14 @@ size_t TType::getObjectSize() const
return totalSize;
}
TStructure::TStructure(const TString *name, TFieldList *fields)
: TFieldListCollection(name, fields),
mDeepestNesting(0),
mUniqueId(TSymbolTable::nextUniqueId()),
mAtGlobalScope(false)
{
}
bool TStructure::containsArrays() const
{
for (size_t i = 0; i < mFields->size(); ++i)
......
......@@ -103,13 +103,7 @@ class TStructure : public TFieldListCollection
{
public:
POOL_ALLOCATOR_NEW_DELETE();
TStructure(const TString *name, TFieldList *fields)
: TFieldListCollection(name, fields),
mDeepestNesting(0),
mUniqueId(0),
mAtGlobalScope(false)
{
}
TStructure(const TString *name, TFieldList *fields);
int deepestNesting() const
{
......
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