aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-12-21 12:00:28 +0100
committerSverker Eriksson <[email protected]>2018-01-03 16:43:31 +0100
commit898352fd68022432c1e6f8d9b7a926394d3e8899 (patch)
treed6ceb35362f547e6291ade648728d068842fde15 /erts/emulator
parent3d21f793538927ae88f78504a11dd898e8ca1a7a (diff)
downloadotp-898352fd68022432c1e6f8d9b7a926394d3e8899.tar.gz
otp-898352fd68022432c1e6f8d9b7a926394d3e8899.tar.bz2
otp-898352fd68022432c1e6f8d9b7a926394d3e8899.zip
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.
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/hipe/hipe_mkliterals.c7
1 files changed, 7 insertions, 0 deletions
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;
}