Merge pull request #2 from groby/parse-fix

Fix OSX 10.10 parse issues
diff --git a/bloat.py b/bloat.py
index d34458e..2e01afe 100755
--- a/bloat.py
+++ b/bloat.py
@@ -67,7 +67,10 @@
 
     # matches:
     #   0x100000EA0	0x000015B7	[  1] __ZN5cl....N4llvm9StringRefE
-    sym_re = re.compile(r'^(0x[0-9A-F]+)\t(0x[0-9A-F]+)\t\[\s*(\d+)\] (.+)$')
+    sym_re = re.compile(r'^(0x[0-9A-F]+)\s+(0x[0-9A-F]+)\s+\[\s*(\d+)\] (.+)$')
+
+    # matches beginning of a symbol.
+    sym_begin_re = re.compile(r'^(0x[0-9A-F]+)')
 
     for line in input:
         line = line.rstrip()
@@ -105,6 +108,12 @@
             path = objfiles[file_index]
             yield sym, 't', size, path
             continue
+          # Literal strings can span multiple lines, and there is no
+          # defined end character. So unless it looks like the start
+          # of a new symbol, we _must_ skip parsing.
+          match = sym_begin_re.match(line)
+          if not match:
+            continue
 
         print >>sys.stderr, 'unparsed:', repr(line)