Skip to content

Conversation

@jayrm
Copy link
Member

@jayrm jayrm commented Jul 28, 2019

Check for ranges that would produce unreasonably large jump tables (greater than 8192 entries)

I am confident, due all previous testing, that fbc was already correctly doing the following:

  • generating valid jump tables for select case as const in the emitter
  • check limits on case from-value to to-value statements and error on range too large
  • check limits on internal record keeping structures, and error on overflow

The main check missing, is an overall range check for the entire select case as const ... end select compound structure.

This update adds checks to ensure that while parsing the select case as const structure, that no case statement is out of range + or - 8192 from the first case statement range value. And that overall range is maximum of 8192 upon reaching the end select statement.

- check for ranges that would produce unreasonably large jump tables (greater than 8192 entries)
@jayrm jayrm merged commit 13d198e into freebasic:master Jul 28, 2019
@jayrm jayrm deleted the select-case-const branch July 28, 2019 02:33
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.

1 participant