Skip to content

Commit

Permalink
Fix signedness errors in bytecode reader
Browse files Browse the repository at this point in the history
  • Loading branch information
niner committed Nov 28, 2019
1 parent c68ed2b commit 6953ca6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/bytecode.c
Expand Up @@ -726,7 +726,7 @@ void MVM_bytecode_finish_frame(MVMThreadContext *tc, MVMCompUnit *cu,

/* Gets the SC reference for a given static lexical var for
* vivification purposes */
MVMuint8 MVM_bytecode_find_static_lexical_scref(MVMThreadContext *tc, MVMCompUnit *cu, MVMStaticFrame *sf, MVMuint16 index, MVMint32 *sc, MVMint32 *id) {
MVMuint8 MVM_bytecode_find_static_lexical_scref(MVMThreadContext *tc, MVMCompUnit *cu, MVMStaticFrame *sf, MVMuint16 index, MVMuint32 *sc, MVMuint32 *id) {
MVMuint16 slvs, i;

MVMuint8 *pos = sf->body.frame_static_lex_pos;
Expand Down Expand Up @@ -943,7 +943,7 @@ MVMBytecodeAnnotation * MVM_bytecode_resolve_annotation(MVMThreadContext *tc, MV
if (sfb->num_annotations && offset < sfb->bytecode_size) {
MVMuint8 *cur_anno = sfb->annotations_data;
for (i = 0; i < sfb->num_annotations; i++) {
MVMint32 ann_offset = read_int32(cur_anno, 0);
MVMuint32 ann_offset = read_int32(cur_anno, 0);
if (ann_offset > offset)
break;
cur_anno += 12;
Expand Down
2 changes: 1 addition & 1 deletion src/core/bytecode.h
Expand Up @@ -11,4 +11,4 @@ void MVM_bytecode_unpack(MVMThreadContext *tc, MVMCompUnit *cu);
MVMBytecodeAnnotation * MVM_bytecode_resolve_annotation(MVMThreadContext *tc, MVMStaticFrameBody *sfb, MVMuint32 offset);
void MVM_bytecode_advance_annotation(MVMThreadContext *tc, MVMStaticFrameBody *sfb, MVMBytecodeAnnotation *ba);
void MVM_bytecode_finish_frame(MVMThreadContext *tc, MVMCompUnit *cu, MVMStaticFrame *sf, MVMint32 dump_only);
MVMuint8 MVM_bytecode_find_static_lexical_scref(MVMThreadContext *tc, MVMCompUnit *cu, MVMStaticFrame *sf, MVMuint16 index, MVMint32 *sc, MVMint32 *id);
MVMuint8 MVM_bytecode_find_static_lexical_scref(MVMThreadContext *tc, MVMCompUnit *cu, MVMStaticFrame *sf, MVMuint16 index, MVMuint32 *sc, MVMuint32 *id);
2 changes: 1 addition & 1 deletion src/core/frame.c
Expand Up @@ -1251,7 +1251,7 @@ MVMObject * MVM_frame_vivify_lexical(MVMThreadContext *tc, MVMFrame *f, MVMuint1
}
flag = flags ? flags[effective_idx] : -1;
if (flag != -1 && static_env[effective_idx].o == NULL) {
MVMint32 scid, objid;
MVMuint32 scid, objid;
if (MVM_bytecode_find_static_lexical_scref(tc, effective_sf->body.cu,
effective_sf, effective_idx, &scid, &objid)) {
MVMSerializationContext *sc;
Expand Down

0 comments on commit 6953ca6

Please sign in to comment.