Skip to content

Commit

Permalink
Fix persistent_term:get/1 builtin.
Browse files Browse the repository at this point in the history
Prior to this fix the mock for that function would fail
with `badarg' because it was translated to
`ets:lookup_element(?persistent_term, 2, Key)' instead of
`ets:lookup_element(?persistent_term, Key, 2)'.
  • Loading branch information
ieQu1 committed Dec 19, 2024
1 parent 56a7fd7 commit 75e5d02
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/concuerror_callback.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,8 @@ run_built_in(persistent_term, Name, Arity, Args, Info) ->
{erase, 1} ->
run_built_in(ets, delete, 2, [?persistent_term|Args], Info);
{get, 1} ->
run_built_in(ets, lookup_element, 3, [?persistent_term, 2|Args], Info);
[Key] = Args,
run_built_in(ets, lookup_element, 3, [?persistent_term, Key, 2], Info);
{get, 2} ->
[Key, Default] = Args,
{R, NewInfo} =
Expand Down

0 comments on commit 75e5d02

Please sign in to comment.