Skip to content

Instantly share code, notes, and snippets.

@jfacorro
Last active May 25, 2019 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfacorro/45dabed610a1874e84df4b697ef0a6e2 to your computer and use it in GitHub Desktop.
Save jfacorro/45dabed610a1874e84df4b697ef0a6e2 to your computer and use it in GitHub Desktop.
Example core file that doesn't load in OTP 22
module 'example' ['f'/1,
'module_info'/0,
'module_info'/1]
attributes []
'f'/1 = fun (_1) ->
case <_1> of
<~{'foo':='foo'}~> when 'true' ->
_1
end
'module_info'/0 = fun () -> call 'erlang':'get_module_info'('example')
'module_info'/1 = fun (_0) -> call 'erlang':'get_module_info'('example', _0)
end
➜ ~ erlc +from_core example.core
➜ ~ erl -sname foo
Erlang/OTP 22 [erts-10.4] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]
Eshell V10.4 (abort with ^G)
(foo@C02X74D6JGH5)1> code:load_file(example).
=ERROR REPORT==== 25-May-2019::14:40:18.244091 ===
beam/beam_load.c(2314): Error loading function example:f/1: op i_get_map_element_hash p x a u x:
no specific operation found
{error,badfile}
=ERROR REPORT==== 25-May-2019::14:40:18.244100 ===
Loading of /Users/juan.facorro/example.beam failed: badfile
(foo@C02X74D6JGH5)2>
module 'example' ['f'/1,
'module_info'/0,
'module_info'/1]
attributes []
'f'/1 = fun (_1) ->
case <_1> of
<~{'foo':='foo'}~> when 'true' ->
_1
_2 when 'true' -> 'ok'
end
'module_info'/0 = fun () -> call 'erlang':'get_module_info'('example')
'module_info'/1 = fun (_0) -> call 'erlang':'get_module_info'('example', _0)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment