summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSebastian Graf <sgraf1337@gmail.com>2017-12-12 16:37:33 +0100
committerJohannes Bucher <johannes.bucher2@student.kit.edu>2018-08-28 13:22:56 +0200
commitb6ac627bb98c7dbb08f2ad908943686670381160 (patch)
tree542f2835663c95bd87e07b730314b891fe10b22e
parent0869251006d3fe161788c18b5d9d01cad56a2cc2 (diff)
Fixed non-termination in the parser while merging attribute lists
-rw-r--r--src/ast/attribute.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ast/attribute.c b/src/ast/attribute.c
index 7709f5d..ef817a1 100644
--- a/src/ast/attribute.c
+++ b/src/ast/attribute.c
@@ -536,6 +536,10 @@ static bool property_attribute_equal(const attribute_property_argument_t *prop1,
static bool attribute_argument_equal(const attribute_argument_t *arg1,
const attribute_argument_t *arg2)
{
+ if (arg1 == arg2)
+ /* This is vital for avoiding cycles when merging attribute lists */
+ return true;
+
if (arg1->kind != arg2->kind)
return false;
@@ -543,7 +547,9 @@ static bool attribute_argument_equal(const attribute_argument_t *arg1,
case ATTRIBUTE_ARGUMENT_SYMBOL:
return arg1->v.symbol == arg2->v.symbol;
case ATTRIBUTE_ARGUMENT_EXPRESSION:
- /* TODO */
+ /* TODO: As of Dec 2017, an equality check for expression_t
+ is not implemented.
+ */
return false;
}
panic("unknown argument type");