Commit d48faaeb authored by Stefan Behnel's avatar Stefan Behnel

array size must be set as int, not numeric string

parent ec09b000
......@@ -442,6 +442,11 @@ class CArrayDeclaratorNode(CDeclaratorNode):
if not self.dimension.type.is_int:
error(self.dimension.pos, "Array dimension not integer")
size = self.dimension.result()
try:
size = int(size)
except ValueError:
# runtime constant?
pass
else:
size = None
if not base_type.is_complete():
......
......@@ -616,6 +616,7 @@ class CArrayType(CType):
is_array = 1
def __init__(self, base_type, size):
assert size is None or isinstance(size, int), repr(size)
self.base_type = base_type
self.size = size
if base_type is c_char_type:
......
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