trifork / erjang

A JVM-based Erlang VM
http://www.erjang.org
Apache License 2.0
727 stars 62 forks source link

binary matching problem #65

Closed krestenkrab closed 11 years ago

krestenkrab commented 11 years ago

The following is not good

krab$ ./ej
** Erjang R16B01 **  [root:/Users/krab/erlang/r16b01] [erts:5.10.2] [unicode]
Eshell V5.10.2  (abort with ^G)
1> filename:join([<<"abc">>]).
<<"b">>
2> filename:join(["abc"]).
"abc"
3>     

In BEAM you get

Eshell V5.10.2  (abort with ^G)
1> filename:join([<<"abc">>]).
<<"abc">>
2> filename:join(["abc"]).
"abc"
3> 

The problem seems to be inside filename:join1b/4, which uses binary matching with the feature to save a match context.