Fixed AnalyseAsm so that it can parse negative literals in the assembly code

This commit is contained in:
Neil Brown 2007-10-07 15:09:36 +00:00
parent 5450f77963
commit 4e6938e0ae

View File

@ -78,6 +78,11 @@ parseAsmLine s
incdecRE = mkRegex "^subl (.*), %esp$"
parseVal :: String -> Int
-- The numbers can be negative:
parseVal ('$':'-':s)
= case readDec s of
[(v, "")] -> -v
_ -> error $ "Don't know how to parse assembly literal: -" ++ s
parseVal ('$':s)
= case readDec s of
[(v, "")] -> v