Skip to content
Snippets Groups Projects
Commit 9fc3e258 authored by Xun Yang's avatar Xun Yang
Browse files

cast fix

parent e3615518
No related branches found
No related tags found
2 merge requests!30New new string,!20Master
......@@ -722,6 +722,17 @@ class ExprNode(ASTNode):
else:
if self.right.myType.assignable(self.left.myType):
self.code += p("mov", "eax", "1")
n = getCFlowLabel()
endLabel = "_end" + n
self.left.codeGen()
self.code += self.left.code
self.code += p("cmp", "eax", "[G__Zero]")
self.code += p("mov", "eax", "1")
self.code += p("jne", endLabel)
self.code += p("mov", "eax", "0")
self.code += p(endLabel + ":", "")
else:
self.code += p("mov", "eax", "0")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment