You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemds.apache.org by mb...@apache.org on 2023/10/13 13:21:22 UTC

[systemds] 01/02: [MINOR] Fix parser error handling w/ incomplete for/parfor predicates

This is an automated email from the ASF dual-hosted git repository.

mboehm7 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git

commit d98368d22295244a01ce23536f4c0cfbffb6e526
Author: Matthias Boehm <mb...@gmail.com>
AuthorDate: Fri Oct 13 15:05:47 2023 +0200

    [MINOR] Fix parser error handling w/ incomplete for/parfor predicates
---
 src/main/java/org/apache/sysds/parser/dml/DmlSyntacticValidator.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/main/java/org/apache/sysds/parser/dml/DmlSyntacticValidator.java b/src/main/java/org/apache/sysds/parser/dml/DmlSyntacticValidator.java
index fe8d1d85d5..b80c4d569a 100644
--- a/src/main/java/org/apache/sysds/parser/dml/DmlSyntacticValidator.java
+++ b/src/main/java/org/apache/sysds/parser/dml/DmlSyntacticValidator.java
@@ -805,6 +805,10 @@ public class DmlSyntacticValidator implements DmlListener {
 	@Override
 	public void exitIterablePredicateColonExpression(IterablePredicateColonExpressionContext ctx) {
 		ctx.info.from = ctx.from.info.expr;
+		if( ctx.to == null ) {
+			notifyErrorListeners("incorrect for/parfor loop bounds: \'" + ctx.info.from + " : "+ctx.info.to+"\'.", ctx.start);
+			return;
+		}
 		ctx.info.to = ctx.to.info.expr;
 		ctx.info.increment = null;
 	}