Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] java.lang.ArrayIndexOutOfBoundsException [sf#70] #72

Closed
lsf37 opened this issue Feb 15, 2015 · 5 comments
Closed

[Bug] java.lang.ArrayIndexOutOfBoundsException [sf#70] #72

lsf37 opened this issue Feb 15, 2015 · 5 comments
Assignees
Labels
bug Not working as intended duplicate This issue was already reported

Comments

@lsf37
Copy link
Member

lsf37 commented Feb 15, 2015

Reported by bineshb on 2004-11-05 04:11 UTC
I have an extremely simple parser, which chokes on a
file with java.lang.ArrayIndexOutOfBoundsException at
the arraycopy in the function below...

private boolean zzRefill() throws java.io.IOException {

/* first: make room (if you can) */
if (zzStartRead > 0) {
System.arraycopy(zzBuffer, zzStartRead,
zzBuffer, 0,
zzEndRead-zzStartRead);

/* translate stored positions */
zzEndRead-= zzStartRead;
zzCurrentPos-= zzStartRead;
zzMarkedPos-= zzStartRead; 
zzPushbackPos-= zzStartRead;
zzStartRead = 0;  
}

I don't know the cause, but, I've attached the classes
and the data, and a cmd shell to drive it.

good.txt works, and problem.txt doesn't work... If you
diff them, you'll see that all I did was replace the
carriage return on line 625 with a space.

I noticed an interesting thing, if I took out %line
from the parser, then I don't get the error...

@lsf37 lsf37 changed the title java.lang.ArrayIndexOutOfBoundsException [Bug] java.lang.ArrayIndexOutOfBoundsException [sf#70] Feb 15, 2015
@lsf37 lsf37 added this to the jflex bug milestone Feb 15, 2015
@lsf37 lsf37 closed this as completed Feb 15, 2015
@lsf37
Copy link
Member Author

lsf37 commented Feb 15, 2015

Commented by bineshb on 2004-11-05 04:11 UTC
Zip file of the parser and the error file.

@lsf37
Copy link
Member Author

lsf37 commented Feb 15, 2015

Commented by lsf37 on 2004-11-05 13:31 UTC
Logged In: YES
user_id=93534

Thanks for the simple test case. This might be a duplicate
of bug #62 (buffer expansion bug in yy_refill()) which
should be fixed in the repository version. I'll try to take
a closer look at this over the weekend

Gerwin

@lsf37
Copy link
Member Author

lsf37 commented Feb 15, 2015

Updated by lsf37 on 2004-11-05 13:31 UTC

  • labels: --> backend/codegen
  • assigned_to: nobody --> lsf37
  • status: open --> open-accepted

@lsf37
Copy link
Member Author

lsf37 commented Feb 15, 2015

Commented by lsf37 on 2004-11-06 08:08 UTC
Logged In: YES
user_id=93534

I can confirm now that this is another manifestation of bug #62.
The repository version contains a fix, it will be released with the next JFlex version.

Gerwin

@lsf37
Copy link
Member Author

lsf37 commented Feb 15, 2015

Updated by lsf37 on 2004-11-06 08:08 UTC

  • status: open-accepted --> closed

@lsf37 lsf37 added the bug Not working as intended label Feb 17, 2015
@lsf37 lsf37 modified the milestone: jflex bug Feb 17, 2015
@regisd regisd added the duplicate This issue was already reported label Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended duplicate This issue was already reported
Projects
None yet
Development

No branches or pull requests

2 participants