Commit 790b0994 authored by Matt Wozniski's avatar Matt Wozniski

Perform <object>NULL check for "except +" calls

parent a19b8a99
......@@ -5838,7 +5838,7 @@ class SimpleCallNode(CallNode):
elif self.type.is_memoryviewslice:
assert self.is_temp
exc_checks.append(self.type.error_condition(self.result()))
else:
elif func_type.exception_check != '+':
exc_val = func_type.exception_value
exc_check = func_type.exception_check
if exc_val is not None:
......@@ -5859,10 +5859,6 @@ class SimpleCallNode(CallNode):
rhs = typecast(py_object_type, self.type, rhs)
else:
lhs = ""
if func_type.exception_check == '+':
translate_cpp_exception(code, self.pos, '%s%s;' % (lhs, rhs),
func_type.exception_value, self.nogil)
else:
if (self.overflowcheck
and self.type.is_int
and self.type.signed
......@@ -5873,6 +5869,12 @@ class SimpleCallNode(CallNode):
goto_error = code.error_goto_if(" && ".join(exc_checks), self.pos)
else:
goto_error = ""
if func_type.exception_check == '+':
translate_cpp_exception(code, self.pos, '%s%s;' % (lhs, rhs),
func_type.exception_value, self.nogil)
if goto_error:
code.putln(goto_error)
else:
code.putln("%s%s; %s" % (lhs, rhs, goto_error))
if self.type.is_pyobject and self.result():
code.put_gotref(self.py_result())
......
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