Commit b338b0bf authored by gsamain's avatar gsamain

Fix checks written about optional arguments when there is no one

parent 8cb165b4
...@@ -1170,24 +1170,25 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -1170,24 +1170,25 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if narg.type.is_cyp_class: if narg.type.is_cyp_class:
code.putln("%s(this->%s);" % (op_lbda(narg), narg.cname)) code.putln("%s(this->%s);" % (op_lbda(narg), narg.cname))
code.putln("if (this->%s != NULL) {" % opt_arg_name) if opt_arg_count:
num_if = 0 code.putln("if (this->%s != NULL) {" % opt_arg_name)
for opt_idx, optarg in enumerate(func_type.args[narg_count:]): num_if = 0
if optarg.type.is_cyp_class: for opt_idx, optarg in enumerate(func_type.args[narg_count:]):
code.putln("if (this->%s->%sn > %s) {" % if optarg.type.is_cyp_class:
(opt_arg_name, code.putln("if (this->%s->%sn > %s) {" %
Naming.pyrex_prefix, (opt_arg_name,
opt_idx Naming.pyrex_prefix,
)) opt_idx
code.putln("%s(this->%s->%s);" % ))
(op_lbda(optarg), code.putln("%s(this->%s->%s);" %
opt_arg_name, (op_lbda(optarg),
func_type.opt_arg_cname(optarg.name) opt_arg_name,
)) func_type.opt_arg_cname(optarg.name)
num_if += 1 ))
for _ in range(num_if): num_if += 1
for _ in range(num_if):
code.putln("}")
code.putln("}") code.putln("}")
code.putln("}")
for reifying_class_entry in entry.type.scope.reifying_entries: for reifying_class_entry in entry.type.scope.reifying_entries:
reified_function_entry = reifying_class_entry.reified_entry reified_function_entry = reifying_class_entry.reified_entry
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment