Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message if the function hashmap is not detected #1246

Open
montyly opened this issue May 1, 2024 · 2 comments
Open

Improve error message if the function hashmap is not detected #1246

montyly opened this issue May 1, 2024 · 2 comments

Comments

@montyly
Copy link
Member

montyly commented May 1, 2024

prepareHashMaps cs as m =
let
(hm, lm) =
( Map.unionWith NEE.union (filterHashMap not cs m) (filterHashMap id as m)
, filterHashMap id cs m )
in
if | Map.size hm > 0 && Map.size lm > 0 -> (hm, Just lm) -- Usual case
| Map.size hm > 0 && Map.size lm == 0 -> (hm, Nothing) -- No low-priority functions detected
| Map.size hm == 0 && Map.size lm > 0 -> (m, Nothing) -- No high-priority functions detected
| otherwise -> error "Error processing function hashmaps"
where
filterHashMap f xs =
Map.mapMaybe (NE.nonEmpty . NE.filter (\s -> f $ (hashSig . encodeSig $ s) `elem` xs))

If the user provides a wrong filterFunctions, echidna crashes and the error message is not really clear:
image

We should change Error processing function hashmaps to something like Please verify the "filterFunctions" option or something like that, and ideally shows the ones that not found

@ggrieco-tob
Copy link
Member

Good catch, we should fix this

@ggrieco-tob
Copy link
Member

This should be fixed in #1258

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants