diff options
-rwxr-xr-x | pp2cc.py | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -243,10 +243,7 @@ class Parse(object): if name in self.functions: function = self.functions[name] return function.labelBegin() - # name not found :? perhaps an external declaration - lbl = "fn_" + name - self.logger.warning("call to undefined function, assuming label '{}'".format(lbl)) - return lbl + return None def parseCompound(self, linked_node): linked_node.incrementLevel() @@ -749,7 +746,13 @@ class Parse(object): lines += line lines.append(self.asm.push(result_reg)) - lines.append(self.asm.branch_op("BRS", self.functionLabel(funcname))) + lbl_func = self.functionLabel(funcname) + if lbl_func is None: + # name not found :? perhaps an external declaration + lbl = "fn_" + funcname + self.logger.warning("call to undefined function, assuming label" + " '{}'".format(lbl), linked_node=linked_node) + lines.append(self.asm.branch_op("BRS", lbl_func)) if params: lines.append(self.asm.binary_op("ADD", "SP", len(params.exprs))) |