diff options
Diffstat (limited to 'erts/emulator/beam/beam_load.c')
-rw-r--r-- | erts/emulator/beam/beam_load.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 85beba57ee..d051085023 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2022. All Rights Reserved. + * Copyright Ericsson AB 1996-2023. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ Uint erts_total_code_size; static int load_code(LoaderState *stp); -#define PLEASE_RECOMPILE "please re-compile this module with an Erlang/OTP " ERLANG_OTP_RELEASE " compiler" +#define PLEASE_RECOMPILE "please re-compile this module with an Erlang/OTP " ERLANG_OTP_RELEASE " compiler or update your Erlang/OTP version" /**********************************************************************/ @@ -215,8 +215,8 @@ erts_finish_loading(Binary* magic, Process* c_p, struct erl_module_instance* inst_p; Module* mod_tab_p; - ERTS_LC_ASSERT(erts_initialized == 0 || erts_has_code_write_permission() || - erts_thr_progress_is_blocking()); + ERTS_LC_ASSERT(erts_initialized == 0 || erts_has_code_load_permission() || + erts_thr_progress_is_blocking()); /* Make current code for the module old and insert the new code * as current. This will fail if there already exists old code @@ -571,6 +571,20 @@ static int load_code(LoaderState* stp) BeamLoadError3(stp, "unsupported guard BIF: %T:%T/%d\n", Mod, Name, arity); } + case genop_bad_bs_match_1: + { + BeamOpArg sub_command = stp->genop->a[0]; + beamopallocator_free_op(&stp->op_allocator, + stp->genop); + stp->genop = NULL; + if (sub_command.type == TAG_a) { + BeamLoadError1(stp, "bs_match: invalid sub instruction '%T' " + "(is this BEAM file generated by a future version of Erlang/OTP?)\n", + sub_command.val); + } else { + BeamLoadError0(stp, "bs_match: invalid operands (corrupt BEAM file?)\n"); + } + } default: BeamLoadError0(stp, "no specific operation found"); } |