Skip to content

Commit

Permalink
Formally bump minimum bytecode version to 5.
Browse files Browse the repository at this point in the history
The code suggests that versions back to 2 are supported, but it has effectively
been at 4 for a very long time, because there is conditional code relating to
earlier versions. Additionally, the serialization blobs of earlier bytecode
files would be rejected, because they will be using a serialization format
version we now no longer support.
  • Loading branch information
nwc10 committed May 16, 2015
1 parent 2b14b67 commit 9349f87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/bytecode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

/* Some constants. */
#define HEADER_SIZE 92
#define MIN_BYTECODE_VERSION 2
#define MIN_BYTECODE_VERSION 5
#define MAX_BYTECODE_VERSION 5
#define FRAME_HEADER_SIZE ((cu->body.bytecode_version >= 4 ? 11 : 9) * 4 + (cu->body.bytecode_version >= 4 ? 3 : 2) * 2)
#define FRAME_HEADER_SIZE (11 * 4 + 3 * 2)
#define FRAME_HANDLER_SIZE (4 * 4 + 2 * 2)
#define FRAME_SLV_SIZE (2 * 2 + 2 * 4)
#define SCDEP_HEADER_OFFSET 12
Expand Down Expand Up @@ -573,7 +573,7 @@ static MVMStaticFrame ** deserialize_frames(MVMThreadContext *tc, MVMCompUnit *c
{
MVMuint32 skip = 2 * static_frame_body->num_locals +
6 * static_frame_body->num_lexicals;
MVMuint16 slvs = cu->body.bytecode_version >= 4 ? read_int16(pos, 40) : 0;
MVMuint16 slvs = read_int16(pos, 40);
pos += FRAME_HEADER_SIZE;
ensure_can_read(tc, cu, rs, pos, skip);
pos += skip;
Expand Down Expand Up @@ -633,7 +633,7 @@ void MVM_bytecode_finish_frame(MVMThreadContext *tc, MVMCompUnit *cu,
pos = sf->body.frame_data_pos;

/* Get the number of static lex values we'll need to apply. */
slvs = cu->body.bytecode_version >= 4 ? read_int16(pos, 40) : 0;
slvs = read_int16(pos, 40);

/* Skip past header. */
pos += FRAME_HEADER_SIZE;
Expand Down

0 comments on commit 9349f87

Please sign in to comment.