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

Cabal-syntax lexer: out-of-bound array access with the JS backend #8892

Closed
hsyl20 opened this issue Apr 3, 2023 · 0 comments
Closed

Cabal-syntax lexer: out-of-bound array access with the JS backend #8892

hsyl20 opened this issue Apr 3, 2023 · 0 comments

Comments

@hsyl20
Copy link
Collaborator

hsyl20 commented Apr 3, 2023

Describe the bug
Due to a bug in Alex, Cabal-syntax's lexer performs an out-of-bound array access. For GHC's native backends it's just a data corruption but for the JS backend it leads to a runtime JS exception (out-of-bound array access).

To Reproduce
Build and run some setup program with the JS backend. E.g. test ImpSafeOnly in GHC's testsuite

Expected behavior
Don't crash.

System information

  • GHC's JS backend in HEAD

Additional context

  • We could fix by manually patching Lexer.hs
  • Or wait for a new release of Alex (>= 3.2.7.2) and use it to regenerate Lexer.hs
@fgaz fgaz added the type: bug label Apr 3, 2023
hsyl20 added a commit to hsyl20/cabal that referenced this issue Apr 4, 2023
Regenerate Lexer.hs with Alex 3.2.7.2 to fix issue #haskell#8892 (out-of-bound
access due to haskell/alex#223).
hsyl20 added a commit to hsyl20/cabal that referenced this issue Apr 4, 2023
Regenerate Lexer.hs with Alex 3.2.7.2 to fix issue #haskell#8892 (out-of-bound
access due to haskell/alex#223).
hsyl20 added a commit to hsyl20/cabal that referenced this issue Apr 4, 2023
Regenerate Lexer.hs with Alex 3.2.7.2 to fix issue #haskell#8892 (out-of-bound
access due to haskell/alex#223).
hsyl20 added a commit to hsyl20/cabal that referenced this issue Apr 4, 2023
Regenerate Lexer.hs with Alex 3.2.7.2 to fix issue #haskell#8892 (out-of-bound
access due to haskell/alex#223).
hsyl20 added a commit to hsyl20/cabal that referenced this issue Apr 14, 2023
Regenerate Lexer.hs with Alex 3.2.7.2 to fix issue #haskell#8892 (out-of-bound
access due to haskell/alex#223).
@mergify mergify bot closed this as completed in ca7a8e2 Apr 26, 2023
mergify bot added a commit that referenced this issue Apr 26, 2023
Regenerate Lexer.hs with latest Alex (fix #8892)
mergify bot pushed a commit that referenced this issue Apr 26, 2023
Regenerate Lexer.hs with Alex 3.2.7.2 to fix issue ##8892 (out-of-bound
access due to haskell/alex#223).

(cherry picked from commit ca7a8e2)
mergify bot added a commit that referenced this issue Apr 26, 2023
Regenerate Lexer.hs with latest Alex (fix #8892) (backport #8896)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants