Skip to content

Commit 621023b

Browse files
[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.
1 parent 08c709a commit 621023b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/include/llvm/MC/MCSectionXCOFF.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ class MCSectionXCOFF final : public MCSection {
5151
(ST == XCOFF::XTY_SD || ST == XCOFF::XTY_CM || ST == XCOFF::XTY_ER) &&
5252
"Invalid or unhandled type for csect.");
5353
assert(QualName != nullptr && "QualName is needed.");
54+
if (SMC == XCOFF::XMC_UL)
55+
assert((ST == XCOFF::XTY_CM || ST == XCOFF::XTY_ER) &&
56+
"Invalid csect type for storage mapping class XCOFF::XMC_UL");
5457

5558
QualName->setRepresentedCsect(this);
5659
QualName->setStorageClass(XCOFF::C_HIDEXT);

0 commit comments

Comments
 (0)