In AnalyseAsm, ignore labels that contain "." anywhere.

GCC appears to generate labels that look like "constantname.1234" for some
array constants.
This commit is contained in:
Adam Sampson 2008-04-06 15:31:28 +00:00
parent b65512b64c
commit 3fcf363a31
2 changed files with 4 additions and 3 deletions

View File

@ -77,7 +77,7 @@ parseAsmLine s
-- digit. -- digit.
parseLabel :: String -> Maybe AsmItem parseLabel :: String -> Maybe AsmItem
parseLabel s@(c:cs) parseLabel s@(c:cs)
| c == '.' || isDigit c = Nothing | isDigit c || '.' `elem` s = Nothing
| last cs == ':' = Just $ AsmLabel (liat s) | last cs == ':' = Just $ AsmLabel (liat s)
| otherwise = Nothing | otherwise = Nothing
where where

View File

@ -57,6 +57,7 @@ testParse = TestList
, testLine 350 ".blah:" $ Nothing , testLine 350 ".blah:" $ Nothing
, testLine 351 "0:" $ Nothing , testLine 351 "0:" $ Nothing
, testLine 352 "blah.1234:" $ Nothing
] ]
where where
testLine :: Int -> String -> Maybe AsmItem -> Test testLine :: Int -> String -> Maybe AsmItem -> Test