- Source code:
foo(X, Y) ->
case X =:= $T orelse X =:= $\s of
true -> {ok, Y};
_ -> error
end.
The problem is described in the comment below:
{function, foo, 2, 2}.
{label,1}.
{line,[{location,"t.erl",4}]}.
{func_info,{atom,t},{atom,foo},2}.
{label,2}.
{test,is_eq_exact,{f,3},[{x,0},{integer,84}]}.
{move,{atom,true},{x,0}}.
{jump,{f,4}}.
{label,3}.
%% The next two lines should be a single test instruction.
{bif,'=:=',{f,0},[{x,0},{integer,32}],{x,0}}.
{test,is_eq_exact,{f,5},[{x,0},{atom,true}]}.
{label,4}.
{test_heap,3,2}.
{put_tuple,2,{x,0}}.
{put,{atom,ok}}.
{put,{x,1}}.
return.
{label,5}.
{move,{atom,error},{x,0}}.
return.