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

charIndex out of range when parsing an incomplete source #39

Closed
numberpi opened this issue Dec 3, 2018 · 2 comments
Closed

charIndex out of range when parsing an incomplete source #39

numberpi opened this issue Dec 3, 2018 · 2 comments

Comments

@numberpi
Copy link

numberpi commented Dec 3, 2018

Parsing a$ causes the following exception:

Caused by: java.lang.IllegalArgumentException: charIndex out of range
	at com.oracle.truffle.api.source.Source.createSection(Source.java:606)
	at com.oracle.truffle.r.engine.REngine.createRScriptRoot(REngine.java:385)
	at com.oracle.truffle.r.engine.REngine.parseToCallTarget(REngine.java:303)
	at com.oracle.truffle.r.engine.TruffleRLanguageImpl.parse(TruffleRLanguageImpl.java:195)
	at com.oracle.truffle.api.TruffleLanguage$ParsingRequest.parse(TruffleLanguage.java:799)
	at com.oracle.truffle.api.TruffleLanguage.parse(TruffleLanguage.java:1246)
	at com.oracle.truffle.api.TruffleLanguage$LanguageImpl.parse(TruffleLanguage.java:2449)
	at com.oracle.truffle.api.instrumentation.TruffleInstrument$Env.parse(TruffleInstrument.java:409)

This is because a new-line character is appended in REngine.createRScriptRoot if a IncompleteSourceException occurs so that the StringBuilder contains more characters than the source.

@steve-s
Copy link
Member

steve-s commented Dec 4, 2018

Hi Daniel,

thanks for the report. We're looking into this.

@steve-s
Copy link
Member

steve-s commented Dec 13, 2018

Should be fixed in d172bee

@steve-s steve-s closed this as completed Dec 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants