From d7430d74481e29f4522b08795a7cfa247ad2e2f3 Mon Sep 17 00:00:00 2001
From: stepan <stepan.sindelar@oracle.com>
Date: Wed, 20 Dec 2017 16:44:14 +0100
Subject: [PATCH] Fix: isSquareMatrix checks dims.length == 2 not >= 2.

---
 .../truffle/r/nodes/attributes/SpecialAttributesFunctions.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/SpecialAttributesFunctions.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/SpecialAttributesFunctions.java
index bec22d6526..36731565a1 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/SpecialAttributesFunctions.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/attributes/SpecialAttributesFunctions.java
@@ -664,7 +664,7 @@ public final class SpecialAttributesFunctions {
 
         public final boolean isSquareMatrix(RAbstractVector vector) {
             RIntVector dims = (RIntVector) execute(vector);
-            if (nullDimsProfile.profile(dims == null) || dims.getLength() < 2) {
+            if (nullDimsProfile.profile(dims == null) || dims.getLength() != 2) {
                 return false;
             }
             return dims.getDataAt(0) == dims.getDataAt(1);
-- 
GitLab