diff python/outstream.py @ 225:1c7364bd74c7

Fixed pointer deref
author Windel Bouwman
date Thu, 11 Jul 2013 07:42:30 +0200
parents 1fa3e0050b49
children 83781bd10fdb
line wrap: on
line diff
--- a/python/outstream.py	Tue Jul 09 17:59:15 2013 +0200
+++ b/python/outstream.py	Thu Jul 11 07:42:30 2013 +0200
@@ -1,5 +1,5 @@
 import binascii
-from asmnodes import ALabel
+from asmnodes import ALabel, AComment
 """
  The output stream is a stream of instructions that can be output
  to a file or binary or hexfile.
@@ -13,6 +13,7 @@
     def __init__(self):
         self.sections = {}
         self.currentSection = None
+
     def emit(self, item):
         self.sections[self.currentSection].append(item)
 
@@ -36,7 +37,7 @@
                 address = 0x0
             for i in self.sections[s]:
                 i.address = address
-                if type(i) is ALabel:
+                if type(i) in [ALabel, AComment]:
                     continue
                 if type(i) is Alignment:
                     while (address % i.align) != 0:
@@ -53,7 +54,7 @@
     def dumpSection(self, s):
         print('.section '+s)
         for i in self.sections[s]:
-            if type(i) is ALabel:
+            if type(i) in [ALabel, AComment]:
                 print(i)
             elif type(i) is Alignment:
                 pass