diff --git a/src/protocol/eval/executor.rs b/src/protocol/eval/executor.rs index 670993cbc27ba8d66c0c91e19b18288c5e7742cf..8a80bd8dce90a3dc81de4d03d545a90e2b1a5d27 100644 --- a/src/protocol/eval/executor.rs +++ b/src/protocol/eval/executor.rs @@ -226,7 +226,6 @@ impl Prompt { }; // Maybe do typechecking in the future? - debug_assert!((monomorph_idx as usize) < _types.get_base_definition(&def).unwrap().definition.procedure_monomorphs().len()); let new_frame = Frame::new(heap, def, monomorph_idx); let max_stack_size = new_frame.max_stack_size; prompt.frames.push(new_frame); @@ -475,7 +474,7 @@ impl Prompt { }, Expression::Select(expr) => { let subject= cur_frame.expr_values.pop_back().unwrap(); - let mono_data = types.get_procedure_expression_data(&cur_frame.definition, cur_frame.monomorph_idx); + let mono_data = types.get_procedure_monomorph(cur_frame.monomorph_idx); let field_idx = mono_data.expr_data[expr.unique_id_in_definition as usize].field_or_monomorph_idx as u32; // Note: same as above: clone if value lives on expr stack, simply @@ -517,7 +516,7 @@ impl Prompt { } Literal::Integer(lit_value) => { use ConcreteTypePart as CTP; - let def_types = types.get_procedure_expression_data(&cur_frame.definition, cur_frame.monomorph_idx); + let def_types = types.get_procedure_monomorph(cur_frame.monomorph_idx); let concrete_type = &def_types.expr_data[expr.unique_id_in_definition as usize].expr_type; debug_assert_eq!(concrete_type.parts.len(), 1); @@ -559,7 +558,7 @@ impl Prompt { cur_frame.expr_values.push_back(value); }, Expression::Cast(expr) => { - let mono_data = types.get_procedure_expression_data(&cur_frame.definition, cur_frame.monomorph_idx); + let mono_data = types.get_procedure_monomorph(cur_frame.monomorph_idx); let output_type = &mono_data.expr_data[expr.unique_id_in_definition as usize].expr_type; // Typechecking reduced this to two cases: either we @@ -741,7 +740,7 @@ impl Prompt { } // Determine the monomorph index of the function we're calling - let mono_data = types.get_procedure_expression_data(&cur_frame.definition, cur_frame.monomorph_idx); + let mono_data = types.get_procedure_monomorph(cur_frame.monomorph_idx); let call_data = &mono_data.expr_data[expr.unique_id_in_definition as usize]; // Push the new frame and reserve its stack size @@ -974,7 +973,7 @@ impl Prompt { "mismatch in expr stack size and number of arguments for new statement" ); - let mono_data = types.get_procedure_expression_data(&cur_frame.definition, cur_frame.monomorph_idx); + let mono_data = types.get_procedure_monomorph(cur_frame.monomorph_idx); let expr_data = &mono_data.expr_data[call_expr.unique_id_in_definition as usize]; // Note that due to expression value evaluation they exist in