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

View File

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