Handle the case when array access results in an address constant.
authorChristoph Mallon <christoph.mallon@gmx.de>
Sun, 14 Sep 2008 21:49:41 +0000 (21:49 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sun, 14 Sep 2008 21:49:41 +0000 (21:49 +0000)
[r21952]

ast.c

diff --git a/ast.c b/ast.c
index a9f8554..1621bb2 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1640,6 +1640,15 @@ bool is_address_constant(const expression_t *expression)
                return false;
        }
 
+       case EXPR_ARRAY_ACCESS: {
+               type_t *const type =
+                       skip_typeref(revert_automatic_type_conversion(expression));
+               return
+                       is_type_array(type)                                    &&
+                       is_constant_expression(expression->array_access.index) &&
+                       is_address_constant(expression->array_access.array_ref);
+       }
+
        default:
                return false;
        }