summaryrefslogtreecommitdiff
path: root/src/ir.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir.cc')
-rw-r--r--src/ir.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ir.cc b/src/ir.cc
index 9b7e414b..5eb511e7 100644
--- a/src/ir.cc
+++ b/src/ir.cc
@@ -319,8 +319,10 @@ FuncType* Module::GetFuncType(const Var& var) {
Index Module::GetFuncTypeIndex(const FuncSignature& sig) const {
for (size_t i = 0; i < types.size(); ++i) {
- if (cast<FuncType>(types[i])->sig == sig) {
- return i;
+ if (auto* func_type = dyn_cast<FuncType>(types[i])) {
+ if (func_type->sig == sig) {
+ return i;
+ }
}
}
return kInvalidIndex;