From 898352fd68022432c1e6f8d9b7a926394d3e8899 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 21 Dec 2017 12:00:28 +0100 Subject: Add PRIMOP_ABI_VSN to erts checksum in order to detect incompatible changes in primop interface (which we just did for bs_put_utf8) and refuse hipe loading. --- erts/emulator/hipe/hipe_mkliterals.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/erts/emulator/hipe/hipe_mkliterals.c b/erts/emulator/hipe/hipe_mkliterals.c index 4573980e1e..1ebe4e1188 100644 --- a/erts/emulator/hipe/hipe_mkliterals.c +++ b/erts/emulator/hipe/hipe_mkliterals.c @@ -535,6 +535,11 @@ static const struct rts_param rts_params[] = { static unsigned int literals_crc; static unsigned int system_crc; +/* + * Change this version value to detect incompatible changes in primop interface. + */ +#define PRIMOP_ABI_VSN 0x090300 /* erts-9.3 */ + static void compute_crc(void) { unsigned int crc_value; @@ -550,6 +555,8 @@ static void compute_crc(void) for (i = 0; i < NR_PARAMS; ++i) if (rts_params[i].is_defined) crc_value = crc_update_int(crc_value, &rts_params[i].value); + + crc_value ^= PRIMOP_ABI_VSN; crc_value &= 0x07FFFFFF; system_crc = crc_value; } -- cgit v1.2.3