#579 - compiler crash on invalid buffer type
authorRobert Bradshaw <robertwb@math.washington.edu>
Sun, 3 Oct 2010 06:40:57 +0000 (23:40 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Sun, 3 Oct 2010 06:40:57 +0000 (23:40 -0700)
Cython/Compiler/Interpreter.py

index 0acbd9231740cd2d59a3a4210924ce74ebe3e769..298041d012a37a9dd0648e3cbdbea77f0cd4c904 100644 (file)
@@ -37,7 +37,10 @@ def interpret_compiletime_options(optlist, optdict, type_env=None, type_args=())
     def interpret(node, ix):
         if ix in type_args:
             if type_env:
-                return (node.analyse_as_type(type_env), node.pos)
+                type = node.analyse_as_type(type_env)
+                if not type:
+                    raise CompileError(node.pos, "Invalid type.")
+                return (type, node.pos)
             else:
                 raise CompileError(node.pos, "Type not allowed here.")
         else: