aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_nif.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2014-03-20 19:01:11 +0100
committerRickard Green <[email protected]>2014-03-21 13:24:40 +0100
commitbf3222f10edbd1f6a5186c8fb35c29900ad0665f (patch)
treefa761309c15de7996634a9474919c9621c126336 /erts/emulator/beam/erl_nif.c
parent3c06b5b3cdde72453d97910889e38e91c1dd4870 (diff)
downloadotp-bf3222f10edbd1f6a5186c8fb35c29900ad0665f.tar.gz
otp-bf3222f10edbd1f6a5186c8fb35c29900ad0665f.tar.bz2
otp-bf3222f10edbd1f6a5186c8fb35c29900ad0665f.zip
Introduce minimum allowed major driver and nif versions on load
Diffstat (limited to 'erts/emulator/beam/erl_nif.c')
-rw-r--r--erts/emulator/beam/erl_nif.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index 40860e141c..063dba056e 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -2049,8 +2049,10 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
(entry = erts_sys_ddll_call_nif_init(init_func)) == NULL)) {
ret = load_nif_error(BIF_P, bad_lib, "Library init-call unsuccessful");
}
- else if (entry->major != ERL_NIF_MAJOR_VERSION
- || entry->minor > ERL_NIF_MINOR_VERSION
+ else if (entry->major < ERL_NIF_MIN_REQUIRED_MAJOR_VERSION_ON_LOAD
+ || (ERL_NIF_MAJOR_VERSION < entry->major
+ || (ERL_NIF_MAJOR_VERSION == entry->major
+ && ERL_NIF_MINOR_VERSION < entry->minor))
|| (entry->major==2 && entry->minor == 5)) { /* experimental maps */
ret = load_nif_error(BIF_P, bad_lib, "Library version (%d.%d) not compatible (with %d.%d).",