diff options
author | Mark Florisson <markflorisson88@gmail.com> | 2012-05-06 18:29:53 +0100 |
---|---|---|
committer | Mark Florisson <markflorisson88@gmail.com> | 2012-05-11 11:48:57 +0100 |
commit | de3cdbbe846a7133bc59c52536e9e7f6575cd093 (patch) | |
tree | aaa82571c929242a683586720271612b11ff83a6 /Cython/Compiler/MemoryView.py | |
parent | 1ad72710009f9675fc46ae07971ffce81c2a0516 (diff) | |
download | cython-de3cdbbe846a7133bc59c52536e9e7f6575cd093.tar.gz |
Don't allow more dimensions than buffer_max_dims
Diffstat (limited to 'Cython/Compiler/MemoryView.py')
-rw-r--r-- | Cython/Compiler/MemoryView.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Cython/Compiler/MemoryView.py b/Cython/Compiler/MemoryView.py index 135a1f39f..bd5ff0faa 100644 --- a/Cython/Compiler/MemoryView.py +++ b/Cython/Compiler/MemoryView.py @@ -723,6 +723,14 @@ def get_axes_specs(env, axes): return axes_specs +def validate_axes(pos, axes): + if len(axes) >= Options.buffer_max_dims: + error(pos, "More dimensions than the maximum number" + " of buffer dimensions were used.") + return False + + return True + def all(it): for item in it: if not item: |