Skip to content

ok bsr ok crashes erl_eval:do_apply/7 #542

Open
@RobinMorisset

Description

@RobinMorisset

Running gradualizer on the following erlang code:

f(<<_:(ok bsr ok)/bytes>>) ->
    ok.

results in the following crash:

escript: exception error: an error occurred when evaluating an arithmetic expression
  in operator  bsr/2
     called as ok bsr ok
  in call from erl_eval:do_apply/7 (erl_eval.erl, line 744)
  in call from gradualizer_bin:bin_element_view/1 (src/gradualizer_bin.erl, line 71)
  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)
  in call from gradualizer_bin:compute_type/1 (src/gradualizer_bin.erl, line 14)
  in call from typechecker:add_type_pat/3 (src/typechecker.erl, line 4949)
  in call from typechecker:add_types_pats/6 (src/typechecker.erl, line 4820)

While it is not very useful Erlang code, I would expect gradualizer to be able to run without crashing on all syntactically valid Erlang code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions