mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix crash in OSLogOptimization
A metatype need not always come from a metatype instruction. It can come from a SILArgument. Fix the invalid cast operation in OSLogOptimization. Fixes rdar://146160325
This commit is contained in:
@@ -163,9 +163,9 @@ public:
|
||||
|
||||
this->stringInitIntrinsic = callee;
|
||||
|
||||
MetatypeInst *stringMetatypeInst =
|
||||
dyn_cast<MetatypeInst>(inst->getOperand(4)->getDefiningInstruction());
|
||||
this->stringMetatype = stringMetatypeInst->getType();
|
||||
auto stringMetatype = inst->getOperand(4)->getType();
|
||||
assert(stringMetatype.isMetatype());
|
||||
this->stringMetatype = stringMetatype;
|
||||
}
|
||||
|
||||
bool isInitialized() { return stringInitIntrinsic != nullptr; }
|
||||
|
||||
Reference in New Issue
Block a user