This function has a case marked Bug?:
|
callHandler :: Overrides -> CallHandler |
|
callHandler callMap sym = Macaw.LookupFunctionHandle $ \st mem regs -> do |
|
case lookupX86Reg X86_IP regs of |
|
Just (RV ptr) | LLVMPointer base off <- ptr -> |
|
case (asNat base, BV.asUnsigned <$> asBV off) of |
|
(Just b, Just o) -> |
|
case Map.lookup (b,o) callMap of |
|
Just h -> case h sym of |
|
Macaw.LookupFunctionHandle f -> f st mem regs |
|
Nothing -> |
|
fail ("No over-ride for function: " ++ show (ppPtr ptr)) |
|
|
|
_ -> fail ("Non-static call: " ++ show (ppPtr ptr)) |
|
|
|
_ -> fail "[Bug?] Failed to obtain the value of the IP register." |
Indeed, it is actually an infeasible case. This could be made more obvious by indexing into the register struct with rip from macaw-symbolic. For an example of how this is done, see this GREASE commit.
This function has a case marked
Bug?:saw-script/saw-central/src/SAWCentral/X86.hs
Lines 396 to 410 in 04597a9
Indeed, it is actually an infeasible case. This could be made more obvious by indexing into the register struct with
ripfrommacaw-symbolic. For an example of how this is done, see this GREASE commit.