diff options
author | John Högberg <[email protected]> | 2018-02-19 15:22:50 +0100 |
---|---|---|
committer | John Högberg <[email protected]> | 2018-02-19 15:22:50 +0100 |
commit | 7e096c55739c241e4c3efc12ec4ced8d5052928e (patch) | |
tree | 45fcc5e3ac5cd763335c4372dbf80dba1ea5421a /erts | |
parent | 652185f5b5b958bdcafc86192e8086b1fa0e12af (diff) | |
parent | 1b3b4386c220e81395c04215d15c727cfdacb65b (diff) | |
download | otp-7e096c55739c241e4c3efc12ec4ced8d5052928e.tar.gz otp-7e096c55739c241e4c3efc12ec4ced8d5052928e.tar.bz2 otp-7e096c55739c241e4c3efc12ec4ced8d5052928e.zip |
Merge branch 'john/erts/ctx-to-binary-size-assert'
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/beam/bs_instrs.tab | 3 |
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); |