From 3dbffcfd51e26092afa7bd5ef3014912152b6b82 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Mon, 21 Jan 2013 08:42:11 +0100 Subject: [PATCH] fix compiler crash in error case --- Cython/Compiler/ExprNodes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 095c322..91d91a0 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -8435,13 +8435,16 @@ class PowNode(NumBinopNode): self.pow_func = "" elif self.type.is_float: self.pow_func = "pow" + self.type.math_h_modifier - else: + elif self.type.is_int: self.pow_func = "__Pyx_pow_%s" % self.type.declaration_code('').replace(' ', '_') env.use_utility_code( int_pow_utility_code.specialize( func_name=self.pow_func, type=self.type.declaration_code(''), signed=self.type.signed and 1 or 0)) + elif not self.type.is_error: + error(self.pos, "got unexpected types for C power operator: %s, %s" % + (self.operand1.type, self.operand2.type)) def calculate_result_code(self): # Work around MSVC overloading ambiguity. -- 2.7.4