Skip to content

Commit 5c40a89

Browse files
committed
erts: Enable re exported format to be forward compatible.
This will enabled us to, for example, add a more extensive checksum while old code can ignore it and just check the old checksum.
1 parent f0e4150 commit 5c40a89

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

erts/emulator/beam/erl_bif_re.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,9 +737,14 @@ re_import_1(BIF_ALIST_1)
737737
const byte *encoded;
738738
Uint encoded_sz;
739739

740-
if (hdr_sz != EXPORTED_HDR_SZ) {
740+
/*
741+
* Allow header to contain more unknow data that we ignore.
742+
* Could be new optional features (such as checksum over fallback)
743+
* that was added while being forward compatible.
744+
*/
745+
/*if (hdr_sz != EXPORTED_HDR_SZ) {
741746
goto badarg;
742-
}
747+
}*/
743748

744749
encoded = erts_get_aligned_binary_bytes(tpl[5], &encoded_sz,
745750
&encoded_tmp_alloc);

0 commit comments

Comments
 (0)