Skip to content
Browse files

Fix compiler crash on non-numeric argument to prange()

  • Loading branch information...
1 parent 2a3f533 commit e4d366eef99ab1cd19b8e9cbeeb9ea7289a2f65f @markflorisson markflorisson committed Aug 1, 2011
Showing with 6 additions and 3 deletions.
  1. +2 −3 Cython/Compiler/
  2. +4 −0 tests/errors/e_cython_parallel.pyx
5 Cython/Compiler/
@@ -6539,9 +6539,8 @@ def analyse_expressions(self, env):
if node is not None:
if not node.type.is_numeric:
- error(node.pos, "%s argument must be numeric or a pointer "
- "(perhaps if a numeric literal is too "
- "big, use 1000LL)" % name)
+ error(node.pos, "%s argument must be numeric" % name)
+ continue
if not node.is_literal:
node = node.coerce_to_temp(env)
4 tests/errors/e_cython_parallel.pyx
@@ -118,6 +118,8 @@ for i in prange(10, nogil=True):
with gil:
print sum
+for pyobj in prange("hello"):
+ pass
_ERRORS = u"""
e_cython_parallel.pyx:3:8: cython.parallel.parallel is not a module
@@ -147,4 +149,6 @@ e_cython_parallel.pyx:98:19: Cannot assign to private of outer parallel block
e_cython_parallel.pyx:104:6: Reductions not allowed for parallel blocks
e_cython_parallel.pyx:110:7: local variable 'i' referenced before assignment
e_cython_parallel.pyx:119:17: Cannot read reduction variable in loop body
+e_cython_parallel.pyx:121:20: stop argument must be numeric
+e_cython_parallel.pyx:121:19: prange() can only be used without the GIL

0 comments on commit e4d366e

Please sign in to comment.
Something went wrong with that request. Please try again.