From: Robert Bradshaw Date: Thu, 23 Apr 2009 10:07:03 +0000 (-0700) Subject: merge cython-devel X-Git-Tag: 0.12.alpha0~309^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b712ad568501d03b26a41bdb85be83c75f5da0c1;p=cython.git merge cython-devel --- b712ad568501d03b26a41bdb85be83c75f5da0c1 diff --cc Cython/Compiler/ExprNodes.py index 9b7e3861,25f655a5..9a371271 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@@ -1642,14 -1761,21 +1642,26 @@@ class IndexNode(ExprNode) error(self.pos, "Invalid index type '%s'" % self.index.type) + self.gil_check(env) + def gil_check(self, env): + if not self.is_buffer_access: + if self.base.type.is_pyobject: + self._gil_check(env) + gil_message = "Indexing Python object" + def gil_check(self, env): + if self.is_buffer_access and env.nogil: + if env.directives['boundscheck']: + error(self.pos, "Cannot check buffer index bounds without gil; use boundscheck(False) directive") + return + elif self.type.is_pyobject: + error(self.pos, "Cannot access buffer with object dtype without gil") + return + super(IndexNode, self).gil_check(env) + + def check_const_addr(self): self.base.check_const_addr() self.index.check_const() diff --cc Cython/Compiler/ModuleNode.py index c61bf473,018fb19d..1fe75c5e --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@@ -249,12 -255,16 +251,12 @@@ class ModuleNode(Nodes.Node, Nodes.Bloc code.globalstate.use_utility_code(refcount_utility_code) - code.putln('const char *%s = "%s";' % (Naming.modulename_cname, self.full_module_name)) + code.putln('#define __Pyx_MODULE_NAME "%s"' % self.full_module_name) code.putln("") code.putln("/* Implementation of %s */" % env.qualified_name) - self.generate_const_definitions(env, code) - self.generate_interned_num_decls(env, code) - self.generate_interned_string_decls(env, code) - self.generate_py_string_decls(env, code) code.globalstate.insert_global_var_declarations_into(code) - + self.generate_cached_builtins_decls(env, code) self.body.generate_function_definitions(env, code) code.mark_pos(None)