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

An invalid utf32 value can crash eval_bits:eval_exp_field/6 #543

Open
RobinMorisset opened this issue Jun 7, 2023 · 0 comments
Open

An invalid utf32 value can crash eval_bits:eval_exp_field/6 #543

RobinMorisset opened this issue Jun 7, 2023 · 0 comments
Labels

Comments

@RobinMorisset
Copy link

Running gradualizer on the following erlang code:

f() when binary_part(<<18446744073709551615/utf32>>, ok, ok) >= ok ->
    ok.

results in the following crash:

escript: exception error: construction of binary failed
  in function  eval_bits:eval_exp_field/6 (eval_bits.erl, line 153)
     *** segment 1 of type 'utf32': expected a non-negative integer encodable as utf32 but got: 18446744073709551615
  in call from eval_bits:create_binary/2 (eval_bits.erl, line 77)
  in call from eval_bits:expr_grp/5 (eval_bits.erl, line 68)
  in call from erl_eval:expr/6 (erl_eval.erl, line 543)
  in call from gradualizer_bin:bin_element_view/1 (src/gradualizer_bin.erl, line 43)
  in call from gradualizer_bin:'-bin_view/1-lc$^0/1-0-'/1 (src/gradualizer_bin.erl, line 35)
  in call from gradualizer_bin:bin_view/1 (src/gradualizer_bin.erl, line 35)
@erszcz erszcz added the bug label Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants