Fix initialization of arrays in TGlslIoMapper
The inVarMaps, outVarMaps, uniformVarMap, and intermediates arrays were being memset with a size 1 bigger than their actual size. They are now initialized correctly, which also allows making inVarMaps, outVarMaps, and uniformVarMap into private members.
This commit is contained in:
parent
b618604e77
commit
015cb4ce5c
2 changed files with 6 additions and 6 deletions
|
|
@ -1601,10 +1601,10 @@ bool TIoMapper::addStage(EShLanguage stage, TIntermediate& intermediate, TInfoSi
|
||||||
}
|
}
|
||||||
|
|
||||||
TGlslIoMapper::TGlslIoMapper() {
|
TGlslIoMapper::TGlslIoMapper() {
|
||||||
memset(inVarMaps, 0, sizeof(TVarLiveMap*) * (EShLangCount + 1));
|
memset(inVarMaps, 0, sizeof(TVarLiveMap*) * EShLangCount);
|
||||||
memset(outVarMaps, 0, sizeof(TVarLiveMap*) * (EShLangCount + 1));
|
memset(outVarMaps, 0, sizeof(TVarLiveMap*) * EShLangCount);
|
||||||
memset(uniformVarMap, 0, sizeof(TVarLiveMap*) * (EShLangCount + 1));
|
memset(uniformVarMap, 0, sizeof(TVarLiveMap*) * EShLangCount);
|
||||||
memset(intermediates, 0, sizeof(TIntermediate*) * (EShLangCount + 1));
|
memset(intermediates, 0, sizeof(TIntermediate*) * EShLangCount);
|
||||||
profile = ENoProfile;
|
profile = ENoProfile;
|
||||||
version = 0;
|
version = 0;
|
||||||
autoPushConstantMaxSize = 128;
|
autoPushConstantMaxSize = 128;
|
||||||
|
|
|
||||||
|
|
@ -214,8 +214,6 @@ public:
|
||||||
// grow the reflection stage by stage
|
// grow the reflection stage by stage
|
||||||
bool addStage(EShLanguage, TIntermediate&, TInfoSink&, TIoMapResolver*) override;
|
bool addStage(EShLanguage, TIntermediate&, TInfoSink&, TIoMapResolver*) override;
|
||||||
bool doMap(TIoMapResolver*, TInfoSink&) override;
|
bool doMap(TIoMapResolver*, TInfoSink&) override;
|
||||||
TVarLiveMap *inVarMaps[EShLangCount], *outVarMaps[EShLangCount],
|
|
||||||
*uniformVarMap[EShLangCount];
|
|
||||||
TIntermediate* intermediates[EShLangCount];
|
TIntermediate* intermediates[EShLangCount];
|
||||||
bool hadError = false;
|
bool hadError = false;
|
||||||
EProfile profile;
|
EProfile profile;
|
||||||
|
|
@ -225,6 +223,8 @@ private:
|
||||||
TString autoPushConstantBlockName;
|
TString autoPushConstantBlockName;
|
||||||
unsigned int autoPushConstantMaxSize;
|
unsigned int autoPushConstantMaxSize;
|
||||||
TLayoutPacking autoPushConstantBlockPacking;
|
TLayoutPacking autoPushConstantBlockPacking;
|
||||||
|
TVarLiveMap *inVarMaps[EShLangCount], *outVarMaps[EShLangCount],
|
||||||
|
*uniformVarMap[EShLangCount];
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace glslang
|
} // end namespace glslang
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue