aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-12-06 16:44:21 +0100
committerBjörn Gustavsson <[email protected]>2011-12-07 07:29:29 +0100
commitd3f9c506627a02f8f258899cab85d0bac9abfa91 (patch)
tree5248e0da7e9fbed3cef213d40a1615ee07160ae5
parenta249d7eac995668788702f275ca682e653bbbc69 (diff)
downloadotp-d3f9c506627a02f8f258899cab85d0bac9abfa91.tar.gz
otp-d3f9c506627a02f8f258899cab85d0bac9abfa91.tar.bz2
otp-d3f9c506627a02f8f258899cab85d0bac9abfa91.zip
BEAM loader: Fix bug that allowed loading of more than two versions
In commit b67d3e5447f4b2bca3ed92f3db84adb3f79f9b16 (which cleaned up handling of error reasons), the test of the return value from beam_make_current_old() in insert_new_code() was not updated, which meant that it never was true and any number of versions of code could be loaded for a module.
-rw-r--r--erts/emulator/beam/beam_load.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c
index e6fbdc0d45..dd788df6e4 100644
--- a/erts/emulator/beam/beam_load.c
+++ b/erts/emulator/beam/beam_load.c
@@ -956,7 +956,7 @@ insert_new_code(Process *c_p, ErtsProcLocks c_p_locks,
Eterm retval;
int i;
- if ((retval = beam_make_current_old(c_p, c_p_locks, module)) < 0) {
+ if ((retval = beam_make_current_old(c_p, c_p_locks, module)) != NIL) {
erts_dsprintf_buf_t *dsbufp = erts_create_logger_dsbuf();
erts_dsprintf(dsbufp,
"Module %T must be purged before loading\n",