Commit 6da89841 authored by Stefan Behnel's avatar Stefan Behnel

reverted rev 809 as it currently leads to crashes

parent dcb7ee06
...@@ -1669,17 +1669,6 @@ class SimpleCallNode(CallNode): ...@@ -1669,17 +1669,6 @@ class SimpleCallNode(CallNode):
func_type = func_type.base_type func_type = func_type.base_type
return func_type return func_type
def exception_checks(self):
func_type = self.function_type()
exc_val = func_type.exception_value
exc_check = func_type.exception_check
if exc_val is None and self.function.entry.visibility != 'extern':
return_type = func_type.return_type
if not return_type.is_struct_or_union and not return_type.is_void:
exc_val = return_type.cast_code(Naming.default_error)
exc_check = 1
return exc_val, exc_check
def analyse_c_function_call(self, env): def analyse_c_function_call(self, env):
func_type = self.function_type() func_type = self.function_type()
# Check function type # Check function type
...@@ -1721,13 +1710,12 @@ class SimpleCallNode(CallNode): ...@@ -1721,13 +1710,12 @@ class SimpleCallNode(CallNode):
"Python object cannot be passed as a varargs parameter") "Python object cannot be passed as a varargs parameter")
# Calc result type and code fragment # Calc result type and code fragment
self.type = func_type.return_type self.type = func_type.return_type
if self.type.is_pyobject: if self.type.is_pyobject \
or func_type.exception_value is not None \
or func_type.exception_check:
self.is_temp = 1 self.is_temp = 1
if self.type.is_pyobject:
self.result_ctype = py_object_type self.result_ctype = py_object_type
else:
exc_val, exc_check = self.exception_checks()
if self.type.is_pyobject or exc_val is not None or exc_check:
self.is_temp = 1
# C++ exception handler # C++ exception handler
if func_type.exception_check == '+': if func_type.exception_check == '+':
if func_type.exception_value is None: if func_type.exception_value is None:
...@@ -1792,7 +1780,8 @@ class SimpleCallNode(CallNode): ...@@ -1792,7 +1780,8 @@ class SimpleCallNode(CallNode):
if self.type.is_pyobject: if self.type.is_pyobject:
exc_checks.append("!%s" % self.result_code) exc_checks.append("!%s" % self.result_code)
else: else:
exc_val, exc_check = self.exception_checks() exc_val = func_type.exception_value
exc_check = func_type.exception_check
if exc_val is not None: if exc_val is not None:
exc_checks.append("%s == %s" % (self.result_code, exc_val)) exc_checks.append("%s == %s" % (self.result_code, exc_val))
if exc_check: if exc_check:
......
...@@ -487,9 +487,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -487,9 +487,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln("#ifndef __cdecl") code.putln("#ifndef __cdecl")
code.putln(" #define __cdecl") code.putln(" #define __cdecl")
code.putln("#endif") code.putln("#endif")
code.putln('');
code.putln('#define %s 0xB0000000B000B0BBLL' % Naming.default_error);
code.putln('');
self.generate_extern_c_macro_definition(code) self.generate_extern_c_macro_definition(code)
code.putln("#include <math.h>") code.putln("#include <math.h>")
code.putln("#define %s" % Naming.api_guard_prefix + self.api_name(env)) code.putln("#define %s" % Naming.api_guard_prefix + self.api_name(env))
......
...@@ -74,7 +74,6 @@ import_star = pyrex_prefix + "import_star" ...@@ -74,7 +74,6 @@ import_star = pyrex_prefix + "import_star"
import_star_set = pyrex_prefix + "import_star_set" import_star_set = pyrex_prefix + "import_star_set"
cur_scope_cname = pyrex_prefix + "cur_scope" cur_scope_cname = pyrex_prefix + "cur_scope"
enc_scope_cname = pyrex_prefix + "enc_scope" enc_scope_cname = pyrex_prefix + "enc_scope"
default_error = pyrex_prefix + "ERROR"
line_c_macro = "__LINE__" line_c_macro = "__LINE__"
......
...@@ -1209,17 +1209,10 @@ class CFuncDefNode(FuncDefNode): ...@@ -1209,17 +1209,10 @@ class CFuncDefNode(FuncDefNode):
if self.return_type.is_pyobject: if self.return_type.is_pyobject:
return "0" return "0"
else: else:
if self.entry.type.exception_value is not None: #return None
return self.entry.type.exception_value return self.entry.type.exception_value
elif self.return_type.is_struct_or_union or self.return_type.is_void:
return None
else:
return self.return_type.cast_code(Naming.default_error)
def caller_will_check_exceptions(self): def caller_will_check_exceptions(self):
if self.entry.type.exception_value is None:
return 1
else:
return self.entry.type.exception_check return self.entry.type.exception_check
def generate_optarg_wrapper_function(self, env, code): def generate_optarg_wrapper_function(self, env, code):
......
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