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

[royale-compiler] branch develop updated: RepairingTokenBuffer: check for array index should be >= 0 instead of > 0

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

joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git


The following commit(s) were added to refs/heads/develop by this push:
     new f1c330e  RepairingTokenBuffer: check for array index should be >= 0 instead of > 0
f1c330e is described below

commit f1c330e151689088a0fecbdd6812c68c23e501f8
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Thu Jul 22 14:11:47 2021 -0700

    RepairingTokenBuffer: check for array index should be >= 0 instead of > 0
---
 .../royale/compiler/internal/parsing/as/RepairingTokenBuffer.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/as/RepairingTokenBuffer.java b/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/as/RepairingTokenBuffer.java
index 0eddd0f..ceb1efc 100644
--- a/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/as/RepairingTokenBuffer.java
+++ b/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/as/RepairingTokenBuffer.java
@@ -127,7 +127,7 @@ public class RepairingTokenBuffer extends BaseRepairingTokenBuffer implements IR
     public ASToken previous()
     {
         final int prevPos = position - 1;
-        if (prevPos < size && prevPos > 0)
+        if (prevPos < size && prevPos >= 0)
             return tokens[prevPos];
         else
             return eofToken;