aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2018-02-19 15:22:50 +0100
committerJohn Högberg <[email protected]>2018-02-19 15:22:50 +0100
commit7e096c55739c241e4c3efc12ec4ced8d5052928e (patch)
tree45fcc5e3ac5cd763335c4372dbf80dba1ea5421a /erts/emulator/beam
parent652185f5b5b958bdcafc86192e8086b1fa0e12af (diff)
parent1b3b4386c220e81395c04215d15c727cfdacb65b (diff)
downloadotp-7e096c55739c241e4c3efc12ec4ced8d5052928e.tar.gz
otp-7e096c55739c241e4c3efc12ec4ced8d5052928e.tar.bz2
otp-7e096c55739c241e4c3efc12ec4ced8d5052928e.zip
Merge branch 'john/erts/ctx-to-binary-size-assert'
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/bs_instrs.tab3
1 files changed, 3 insertions, 0 deletions
diff --git a/erts/emulator/beam/bs_instrs.tab b/erts/emulator/beam/bs_instrs.tab
index b11903a47b..94e0000c8b 100644
--- a/erts/emulator/beam/bs_instrs.tab
+++ b/erts/emulator/beam/bs_instrs.tab
@@ -990,6 +990,9 @@ ctx_to_bin.execute() {
Uint hole_size;
Uint orig = mb->orig;
ErlSubBin* sb = (ErlSubBin *) boxed_val(context);
+ /* Since we're going to overwrite the match state with the result, an
+ * ErlBinMatchState must be at least as large as an ErlSubBin. */
+ ERTS_CT_ASSERT(sizeof(ErlSubBin) <= sizeof(ErlBinMatchState));
hole_size = 1 + header_arity(sb->thing_word) - ERL_SUB_BIN_SIZE;
sb->thing_word = HEADER_SUB_BIN;
sb->size = BYTE_OFFSET(size);