aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_load.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-10-31 14:00:42 +0100
committerBjörn Gustavsson <[email protected]>2011-11-02 11:59:06 +0100
commit82e41d4b3a57774a23a57d345637a0e19e8727d0 (patch)
tree1e40d97d62049e0612930521a5a478acff5e0e4c /erts/emulator/beam/beam_load.c
parent9a6ad15ba103ec7aee2da66f59e371bd863f410c (diff)
downloadotp-82e41d4b3a57774a23a57d345637a0e19e8727d0.tar.gz
otp-82e41d4b3a57774a23a57d345637a0e19e8727d0.tar.bz2
otp-82e41d4b3a57774a23a57d345637a0e19e8727d0.zip
beam_load.c: Clarify error message when loading unsupported BEAM files
Make it clear for the user what has happened and how to fix it when an attempt is made to load a BEAM file containing new instructions that the current run-time system cannot handle. Suggested-by: Thomas Lindgren
Diffstat (limited to 'erts/emulator/beam/beam_load.c')
-rw-r--r--erts/emulator/beam/beam_load.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c
index de4b32b238..57f5ad0a62 100644
--- a/erts/emulator/beam/beam_load.c
+++ b/erts/emulator/beam/beam_load.c
@@ -1570,10 +1570,15 @@ read_code_header(LoaderState* stp)
/*
* Verify the number of the highest opcode used.
*/
-
GetInt(stp, 4, opcode_max);
if (opcode_max > MAX_GENERIC_OPCODE) {
- LoadError2(stp, "use of opcode %d; this emulator supports only up to %d",
+ LoadError2(stp,
+ "This BEAM file was compiled for a later version"
+ " of the run-time system than " ERLANG_OTP_RELEASE ".\n"
+ " To fix this, please recompile this module with an "
+ ERLANG_OTP_RELEASE " compiler.\n"
+ " (Use of opcode %d; this emulator supports "
+ "only up to %d.)",
opcode_max, MAX_GENERIC_OPCODE);
}