self.result(),
self.value,
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
class ImagNode(AtomicNewTempExprNode):
self.result(),
self.value,
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
namespace,
self.interned_cname,
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
elif entry.is_local and False:
# control flow not good enough yet
self.result(),
self.arg.py_result(),
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
self.module_name.py_result(),
name_list_code,
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
class IteratorNode(NewTempExprNode):
self.result(),
self.sequence.py_result(),
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
code.putln("}")
code.putln(code.error_goto_if_PyErr(self.pos))
code.putln("break;")
code.putln("}")
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
code.putln("}")
self.index_unsigned_parameter(),
self.result(),
code.error_goto(self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
def generate_setitem_code(self, value_code, code):
if self.index.type.is_int:
self.start_code(),
self.stop_code(),
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
def generate_assignment_code(self, rhs, code):
self.generate_subexpr_evaluation_code(code)
self.stop.py_result(),
self.step.py_result(),
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
class CallNode(NewTempExprNode):
self.function.py_result(),
arg_code,
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
elif func_type.is_cfunction:
if self.has_optional_args:
actual_nargs = len(self.args)
goto_error = ""
code.putln("%s%s; %s" % (lhs, rhs, goto_error))
if self.type.is_pyobject and self.result():
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
class GeneralCallNode(CallNode):
self.result(),
call_code,
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
class AsTupleNode(ExprNode):
self.result(),
self.arg.py_result(),
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
class AttributeNode(ExprNode):
self.obj.py_result(),
self.interned_attr_cname,
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
else:
# result_code contains what is needed, but we may need to insert
# a check and raise an exception
self.iterator.result(),
rhs.py_result(),
code.error_goto_if_null(self.iterator.result(), self.pos)))
- code.put_gotref(self.iterator.result())
+ code.put_gotref(self.iterator.py_result())
rhs.generate_disposal_code(code)
for i in range(len(self.args)):
item = self.unpacked_items[i]
item.result(),
typecast(item.ctype(), py_object_type, unpack_code),
code.error_goto_if_null(item.result(), self.pos)))
- code.put_gotref(item.result())
+ code.put_gotref(item.py_result())
value_node = self.coerced_unpacked_items[i]
value_node.generate_evaluation_code(code)
code.put_error_if_neg(self.pos,
self.result(),
len(self.args),
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
for i in range(len(self.args)):
arg = self.args[i]
if not arg.result_in_temp():
(self.result(),
len(self.args),
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
for i in range(len(self.args)):
arg = self.args[i]
#if not arg.is_temp:
"%s = PyDict_New(); %s" % (
self.result(),
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
for item in self.key_value_pairs:
item.generate_evaluation_code(code)
if self.type.is_pyobject:
self.cname,
self.module_name,
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
class UnboundMethodNode(ExprNode):
self.function.py_result(),
self.class_cname,
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
class PyCFunctionNode(AtomicNewTempExprNode):
# Helper class used in the implementation of Python
self.result(),
self.pymethdef_cname,
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
#-------------------------------------------------------------------
#
function,
self.operand.py_result(),
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
def type_error(self):
if not self.operand.type.is_error:
self.operand2.py_result(),
extra_args,
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
else:
if self.is_temp:
self.generate_c_operation_code(code)
function,
self.arg.result(),
code.error_goto_if_null(self.result(), self.pos)))
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
class CoerceFromPyTypeNode(CoercionNode):
rhs,
code.error_goto_if(self.type.error_condition(self.result()), self.pos)))
if self.type.is_pyobject:
- code.put_gotref(self.result())
+ code.put_gotref(self.py_result())
class CoerceToBooleanNode(CoercionNode):
if err_val is None and default_retval:
err_val = default_retval
if self.return_type.is_pyobject:
- code.put_xgiveref(Naming.retval_cname)
+ code.put_xgiveref(self.return_type.as_pyobject(Naming.retval_cname))
if err_val is None:
code.putln('__Pyx_FinishRefcountContext();')
else:
func,
arg.hdr_cname,
code.error_goto_if_null(arg.entry.cname, arg.pos)))
- code.put_gotref(arg.entry.cname)
+ code.put_var_gotref(arg.entry)
else:
error(arg.pos,
"Cannot convert argument of type '%s' to Python object"
else:
code.putln("else if (unlikely(Py_TYPE(%s)->tp_dictoffset != 0)) {" % self_arg)
err = code.error_goto_if_null(self.func_node.result(), self.pos)
- code.put_gotref(self.func_node.result())
+ code.put_gotref(self.func_node.py_result())
# need to get attribute manually--scope would return cdef method
code.putln("%s = PyObject_GetAttr(%s, %s); %s" % (self.func_node.result(), self_arg, self.py_func.interned_attr_cname, err))
# It appears that this type is not anywhere exposed in the Python/C API
self.rhs.py_result(),
extra,
code.error_goto_if_null(self.result_value.py_result(), self.pos)))
- code.put_gotref(self.result_value.result())
+ code.put_gotref(self.result_value.py_result())
self.result_value.generate_evaluation_code(code) # May be a type check...
self.rhs.generate_disposal_code(code)
self.rhs.free_temps(code)
self.module.py_result(),
cname,
code.error_goto_if_null(self.item.result(), self.pos)))
- code.put_gotref(self.item.result())
+ code.put_gotref(self.item.py_result())
target.generate_assignment_code(self.item, code)
self.module.generate_disposal_code(code)
self.module.free_temps(code)