[AIX][TLS] Add assert check of valid csect type for the storage mapping class XCOFF::XMC_UL

This patch adds the assert check inside the constructor for the csect (MCSectionXCOFF) to ensure
valid csect type used for the storage mappping class XCOFF:XMC_UL.
This commit is contained in:
Victor Huang 2021-03-08 14:17:57 -06:00
parent 08c709a266
commit 621023b218
1 changed files with 3 additions and 0 deletions

View File

@ -51,6 +51,9 @@ class MCSectionXCOFF final : public MCSection {
(ST == XCOFF::XTY_SD || ST == XCOFF::XTY_CM || ST == XCOFF::XTY_ER) &&
"Invalid or unhandled type for csect.");
assert(QualName != nullptr && "QualName is needed.");
if (SMC == XCOFF::XMC_UL)
assert((ST == XCOFF::XTY_CM || ST == XCOFF::XTY_ER) &&
"Invalid csect type for storage mapping class XCOFF::XMC_UL");
QualName->setRepresentedCsect(this);
QualName->setStorageClass(XCOFF::C_HIDEXT);