GetFirefly / firefly

An alternative BEAM implementation, designed for WebAssembly
Apache License 2.0
3.61k stars 104 forks source link

Compiler will get segmentation fault for some kinds of `when` clauses on function #720

Closed tatsuya6502 closed 1 year ago

tatsuya6502 commented 2 years ago

The following valid Erlang code will cause the Firefly compiler to get segmentation fault:

-module(init).
-export([boot/1]).

boot(_Args) -> ok.

a(X) when X rem 10 == 0 ->
    ok.

b(Y) when Y div 10 > 2 ->
    ok.
$ firefly compile -C no_default_init --bin init.erl
   Compiling init.erl
zsh: segmentation fault  firefly compile -C no_default_init --bin init.erl

Environment

bitwalker commented 1 year ago

Fixed in develop