Mercurial > lcfOS
diff python/ppci/c3/codegenerator.py @ 303:be7f60545368
Final fixups
author | Windel Bouwman |
---|---|
date | Fri, 06 Dec 2013 12:37:48 +0100 |
parents | 6753763d3bec |
children | 0615b5308710 |
line wrap: on
line diff
--- a/python/ppci/c3/codegenerator.py Fri Dec 06 12:09:35 2013 +0100 +++ b/python/ppci/c3/codegenerator.py Fri Dec 06 12:37:48 2013 +0100 @@ -97,14 +97,12 @@ self.emit(ir.Jump(te)) self.setBlock(te) elif type(code) is astnodes.ReturnStatement: - if code.expr: - re = self.genExprCode(code.expr) - self.emit(ir.Move(self.fn.return_value, re)) - self.emit(ir.Jump(self.fn.epiloog)) - b = self.newBlock() - self.setBlock(b) - else: - self.builder.addIns(ir.Return()) + assert code.expr + re = self.genExprCode(code.expr) + self.emit(ir.Move(self.fn.return_value, re)) + self.emit(ir.Jump(self.fn.epiloog)) + b = self.newBlock() + self.setBlock(b) elif type(code) is astnodes.WhileStatement: bbdo = self.newBlock() bbtest = self.newBlock()