Skip to content

Commit

Permalink
don't error when lookup fails in getInferredType
Browse files Browse the repository at this point in the history
  • Loading branch information
Ptival committed Oct 17, 2024
1 parent 07488fb commit 9ef4a25
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Reopt/CFG/LLVM.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2160,8 +2160,7 @@ functionTypeToFTy fty =
mkRet Nothing = FVoidTy
mkRet (Just tau) = macawTypeToFTy tau

-- | Returns the type that was inferred for the given value via constraint
-- solving, if any.
-- | Returns the type that was inferred for the given value via constraint solving, if any.
getInferredType ::
forall arch es tp.
GetInferredTypeEffects arch es =>
Expand Down Expand Up @@ -2197,7 +2196,7 @@ getInferredType pxy (FnArg arg _typ) = do
getInferredType _ (FnCodePointer fn) = do
mc <- R.ask @(ModuleConstraints arch)
case Map.lookup fn (mcFunTypes mc) of
Nothing -> error $ "getInferredType: lookup failed for " <> show (PP.pretty fn)
Nothing -> return Nothing
Just fty ->
case asFullyResolvedFunctionType mc fty of
Just ty -> return $ Just ty
Expand Down

0 comments on commit 9ef4a25

Please sign in to comment.