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

More variable used problems in buffers fixed

parent d34a5f7e
...@@ -119,7 +119,8 @@ def used_buffer_aux_vars(entry): ...@@ -119,7 +119,8 @@ def used_buffer_aux_vars(entry):
buffer_aux.buffer_info_var.used = True buffer_aux.buffer_info_var.used = True
for s in buffer_aux.shapevars: s.used = True for s in buffer_aux.shapevars: s.used = True
for s in buffer_aux.stridevars: s.used = True for s in buffer_aux.stridevars: s.used = True
for s in buffer_aux.suboffsetvars: 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): def put_unpack_buffer_aux_into_scope(buffer_aux, mode, code):
# Generate code to copy the needed struct info into local # Generate code to copy the needed struct info into local
......
...@@ -885,9 +885,6 @@ class NameNode(AtomicExprNode): ...@@ -885,9 +885,6 @@ class NameNode(AtomicExprNode):
self.type = PyrexTypes.error_type self.type = PyrexTypes.error_type
self.entry.used = 1 self.entry.used = 1
if self.entry.type.is_buffer: 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 import Buffer
Buffer.used_buffer_aux_vars(self.entry) Buffer.used_buffer_aux_vars(self.entry)
...@@ -964,6 +961,9 @@ class NameNode(AtomicExprNode): ...@@ -964,6 +961,9 @@ class NameNode(AtomicExprNode):
entry = self.entry entry = self.entry
if entry: if entry:
entry.used = 1 entry.used = 1
if entry.type.is_buffer:
import Buffer
Buffer.used_buffer_aux_vars(entry)
if entry.utility_code: if entry.utility_code:
env.use_utility_code(entry.utility_code) env.use_utility_code(entry.utility_code)
......
...@@ -34,14 +34,18 @@ def testcas(a): ...@@ -34,14 +34,18 @@ def testcas(a):
# Buffer acquire and release tests # Buffer acquire and release tests
# #
@testcase
def nousage(): def nousage():
""" """
>>> True The challenge here is just compilation.
True """
cdef object[int, 2] buf
def printbuf():
"""
Just compilation.
""" """
cdef object[int, 2] buf cdef object[int, 2] buf
# this used not to compile print buf
@testcase @testcase
def acquire_release(o1, o2): 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