Skip to content

Commit e1a14cf

Browse files
committed
[5.3] SIL: don't crash on unknown array semantics attributes
Instead, just ignore them.
1 parent 4155aba commit e1a14cf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/SILOptimizer/Analysis/ArraySemantic.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,13 @@ void ArraySemanticsCall::initialize(ApplyInst *AI, StringRef semanticName,
183183

184184
// Need a 'self' argument otherwise this is not a semantic call that
185185
// we recognize.
186-
if (getKind() < ArrayCallKind::kArrayInit && !hasSelf())
186+
ArrayCallKind kind = getKind();
187+
if (kind == ArrayCallKind::kNone) {
188+
SemanticsCall = nullptr;
189+
return;
190+
}
191+
192+
if (kind < ArrayCallKind::kArrayInit && !hasSelf())
187193
SemanticsCall = nullptr;
188194

189195
// A arguments must be passed reference count neutral except for self.

0 commit comments

Comments
 (0)