summaryrefslogtreecommitdiff
path: root/src/analysis/scan/exprs
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/scan/exprs')
-rw-r--r--src/analysis/scan/exprs/access.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/analysis/scan/exprs/access.c b/src/analysis/scan/exprs/access.c
index 1c3a880..a8f0dc9 100644
--- a/src/analysis/scan/exprs/access.c
+++ b/src/analysis/scan/exprs/access.c
@@ -428,6 +428,7 @@ static ScanReductionState g_scan_named_access_reduce(GScanNamedAccess *expr, GSc
ScanReductionState result; /* Etat synthétisé à retourner */
GRegisteredItem *resolved; /* Cible concrète obtenue */
GScanExpression *new_next; /* Nouvelle version du suivant */
+ const char *current_rule; /* Nom de la règle courante */
bool status; /* Bilan d'une autre règle */
resolved = _g_scan_named_access_prepare_reduction(expr, ctx, scope);
@@ -478,10 +479,20 @@ static ScanReductionState g_scan_named_access_reduce(GScanNamedAccess *expr, GSc
if (g_scan_context_has_rule_for_name(ctx, expr->target))
{
- status = g_scan_context_has_match_for_rule(ctx, expr->target);
+ current_rule = g_scan_scope_get_rule_name(scope);
- *out = g_scan_literal_expression_new(LVT_BOOLEAN, &status);
- result = SRS_REDUCED;
+ /* Si référence circulaire il y a... */
+ if (strcmp(current_rule, expr->target) == 0)
+ result = SRS_UNRESOLVABLE;
+
+ else
+ {
+ status = g_scan_context_has_match_for_rule(ctx, expr->target);
+
+ *out = g_scan_literal_expression_new(LVT_BOOLEAN, &status);
+ result = SRS_REDUCED;
+
+ }
}