mirror of
https://github.com/GaloisInc/macaw.git
synced 2024-11-28 01:35:33 +03:00
Replace error on duplicate symbol names with just a warning
Symbol names are not always unique (multiple addresses are associated with same name) on code we want to analyze, so just continue anyway.
This commit is contained in:
parent
9f684541dc
commit
d9a516f09f
@ -1098,11 +1098,13 @@ type SymbolNameMap w = Map (SegmentedAddr w) BSC.ByteString
|
||||
--
|
||||
-- It returns either an error message or (Right ()) if no error is found.
|
||||
checkSymbolMap :: SymbolNameMap w -> Either String ()
|
||||
checkSymbolMap symbols
|
||||
| (Set.size symbol_names /= Map.size symbols)
|
||||
, debug DCFG ("WARNING: The symbol name map contains duplicate symbol names") False
|
||||
= error "internal: duplicate symbol names in symbol name map"
|
||||
where symbol_names :: Set BSC.ByteString
|
||||
symbol_names = Set.fromList (Map.elems symbols)
|
||||
checkSymbolMap symbols = do
|
||||
let symbol_names :: Set BSC.ByteString
|
||||
symbol_names = Set.fromList (Map.elems symbols)
|
||||
when (Set.size symbol_names /= Map.size symbols) $ do
|
||||
Left "The symbol name map contains duplicate symbol names"
|
||||
forM_ (Map.elems symbols) $ \sym_nm -> do
|
||||
case BSC.unpack sym_nm of
|
||||
[] -> Left "Empty symbol name"
|
||||
|
Loading…
Reference in New Issue
Block a user