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

Fix out of bounds access when tokenising String_with_vars #232

Merged
merged 1 commit into from
Oct 10, 2017

Conversation

rgrinberg
Copy link
Member

When the current character is '$' we peek at the next character. But we first
need to make sure that there is a next character.

When the current character is '$' we peek at the next character. But we first
need to make sure that there is a next character.
@dra27
Copy link
Member

dra27 commented Aug 25, 2017

All obviously good. Two thoughts while we're here:

  • I don't think there's a way to escape a $ (unless ${$} or $($) is one... I forget).
  • Given that, should $ at the end of a string be an error (but rather better than an indexing error)?

@rgrinberg
Copy link
Member Author

rgrinberg commented Aug 25, 2017 via email

@rgrinberg
Copy link
Member Author

Given that, should $ at the end of a string be an error (but rather better than an indexing error)?

Wait, I'm having second thoughts about this. $ is treated literally unless { or ( follows. Why should end of string be treated any differently?

@dra27
Copy link
Member

dra27 commented Aug 25, 2017

That's a very good point!!

@rgrinberg rgrinberg merged commit 001daa6 into ocaml:master Oct 10, 2017
@rgrinberg rgrinberg deleted the string-with-vars-bounds branch October 10, 2017 19:45
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

Successfully merging this pull request may close these issues.

2 participants