merge cython-devel
authorRobert Bradshaw <robertwb@math.washington.edu>
Thu, 23 Apr 2009 10:07:03 +0000 (03:07 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Thu, 23 Apr 2009 10:07:03 +0000 (03:07 -0700)
1  2 
Cython/Compiler/ExprNodes.py
Cython/Compiler/ModuleNode.py
tests/run/bufaccess.pyx

index 9b7e38617cd39998296fda03447fe864527bd081,25f655a5b7877b8d9e692bb31c9aa7e96a5087a8..9a371271f26a75420cfa1d8fcc9a6bd1dcd565cd
@@@ -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()
index c61bf4734a9e6a092b5f798b0381b63b8a4f84c8,018fb19dbaeb54c9aa394c932b2ea43d89d9b710..1fe75c5e33f47e6beb77974f2d9fde381ef15235
@@@ -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)
Simple merge