diff options
author | Peter Wu <lekensteyn@gmail.com> | 2011-11-30 20:29:21 +0000 |
---|---|---|
committer | Peter Wu <lekensteyn@gmail.com> | 2011-11-30 20:29:21 +0000 |
commit | 4ac454608da0616f4727c10e19161e47570b54db (patch) | |
tree | 81e501452e64f1ce3b1bf0a46016c8ccac3bf01f /pp2cc.py | |
parent | 16eb62608bbec4781621b67550d3c2ebf9c00ff8 (diff) | |
download | pp2cc-4ac454608da0616f4727c10e19161e47570b54db.tar.gz |
Set correct label in ASM
Diffstat (limited to 'pp2cc.py')
-rwxr-xr-x | pp2cc.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -378,7 +378,9 @@ class LinkedNode(object): return self.parent.getContinueNode() return None def setLabel(self, label_name): - """Sets the label for this node""" + """Sets the label for this node and return the label name as it appears + in assembly + """ if self.parent: function = self.parent.getFunctionNode() if not self.parent or not function: @@ -393,6 +395,7 @@ class LinkedNode(object): i += 1 function.goto_labels[label_name] = label_asm + return label_asm def lookupLabel(self, label_name): """Returns the label name as it appears in assembly for label_name""" # get the nearest function for this node @@ -1334,8 +1337,7 @@ class Parse(object): return lines def parseLabel(self, linked_node): lines = [] - label_name = linked_node.node.name - linked_node.setLabel(label_name) + label_name = linked_node.setLabel(linked_node.node.name) lines.append(self.asm.noop(label_name)) lines += self.parseStatement(linked_node.node.stmt, linked_node) return lines |