Commit 9615ebdd authored by Dag Sverre Seljebotn's avatar Dag Sverre Seljebotn

More variable used problems in buffers fixed

parent d34a5f7e
......@@ -119,6 +119,7 @@ def used_buffer_aux_vars(entry):
buffer_aux.buffer_info_var.used = True
for s in buffer_aux.shapevars: s.used = True
for s in buffer_aux.stridevars: s.used = True
if buffer_aux.suboffsetvars:
for s in buffer_aux.suboffsetvars: s.used = True
def put_unpack_buffer_aux_into_scope(buffer_aux, mode, code):
......
......@@ -885,9 +885,6 @@ class NameNode(AtomicExprNode):
self.type = PyrexTypes.error_type
self.entry.used = 1
if self.entry.type.is_buffer:
# Have an rhs temp just in case. All rhs I could
# think of had a single symbol result_code but better
# safe than sorry. Feel free to change this.
import Buffer
Buffer.used_buffer_aux_vars(self.entry)
......@@ -964,6 +961,9 @@ class NameNode(AtomicExprNode):
entry = self.entry
if entry:
entry.used = 1
if entry.type.is_buffer:
import Buffer
Buffer.used_buffer_aux_vars(entry)
if entry.utility_code:
env.use_utility_code(entry.utility_code)
......
......@@ -34,14 +34,18 @@ def testcas(a):
# Buffer acquire and release tests
#
@testcase
def nousage():
"""
>>> True
True
The challenge here is just compilation.
"""
cdef object[int, 2] buf
def printbuf():
"""
Just compilation.
"""
cdef object[int, 2] buf
# this used not to compile
print buf
@testcase
def acquire_release(o1, o2):
......
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