Skip to content

Commit

Permalink
Be sure to emit guards on HOW and lookup values
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Sep 30, 2021
1 parent 7099cff commit c940e0c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/disp/program.c
Expand Up @@ -2129,6 +2129,12 @@ static void emit_attribute_guards(MVMThreadContext *tc, compile_state *cs,
MVMRegister value = ((MVMTracked *)v->tracked)->body.value;
emit_loaded_value_guards(tc, cs, v, temp, value, v->attribute.kind);
}
static void emit_lookup_or_how_guards(MVMThreadContext *tc, compile_state *cs,
MVMDispProgramRecordingValue *v, MVMuint32 value_index) {
MVMuint32 temp = get_temp_holding_value(tc, cs, value_index);
MVMRegister value = ((MVMTracked *)v->tracked)->body.value;
emit_loaded_value_guards(tc, cs, v, temp, value, MVM_CALLSITE_ARG_OBJ);
}
static void emit_resume_state_guards(MVMThreadContext *tc, compile_state *cs,
MVMDispProgramRecordingValue *v, MVMuint32 value_index) {
MVMuint32 temp = get_temp_holding_value(tc, cs, value_index);
Expand Down Expand Up @@ -2501,6 +2507,10 @@ static void emit_value_guards(MVMThreadContext *tc, compile_state *cs,
else if (v->source == MVMDispProgramRecordingAttributeValue) {
emit_attribute_guards(tc, cs, v, i);
}
else if (v->source == MVMDispProgramRecordingLookupValue ||
v->source == MVMDispProgramRecordingHOWValue) {
emit_lookup_or_how_guards(tc, cs, v, i);
}
else if (v->source == MVMDispProgramRecordingResumeStateValue) {
emit_resume_state_guards(tc, cs, v, i);
}
Expand Down

0 comments on commit c940e0c

Please sign in to comment.