Skip to content

Commit b4a1fc6

Browse files
author
Quinn Taylor
committed
Check that pointer type is TupleValue before doing the static cast.
1 parent a0aa318 commit b4a1fc6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/ConstExtract/ConstExtract.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ static std::shared_ptr<CompileTimeValue> extractCompileTimeValue(Expr *expr) {
151151
std::vector<std::shared_ptr<TupleValue>> tuples;
152152
for (auto elementExpr : dictionaryExpr->getElements()) {
153153
auto elementValue = extractCompileTimeValue(elementExpr);
154-
tuples.push_back(std::static_pointer_cast<TupleValue>(elementValue));
154+
if (isa<TupleValue>(elementValue.get())) {
155+
tuples.push_back(std::static_pointer_cast<TupleValue>(elementValue));
156+
}
155157
}
156158
return std::make_shared<DictionaryValue>(tuples);
157159
}

0 commit comments

Comments
 (0)