@@ -133,8 +133,7 @@ class MCScriptExecuteContext
133133 void PushFrame (MCScriptInstanceRef instance,
134134 MCScriptHandlerDefinition *handler,
135135 uindex_t result_reg,
136- const uindex_t *argument_regs,
137- uindex_t argument_count);
136+ MCSpan<const uindex_t > argument_regs);
138137
139138 // Pop the current activation frame and set the return value to the contents
140139 // of the given register. If result_reg is UINDEX_MAX, then it means there is
@@ -687,8 +686,7 @@ inline void
687686MCScriptExecuteContext::PushFrame (MCScriptInstanceRef p_instance,
688687 MCScriptHandlerDefinition *p_handler_def,
689688 uindex_t p_result_reg,
690- const uindex_t *p_argument_regs,
691- uindex_t p_argument_count)
689+ MCSpan<const uindex_t > p_argument_regs)
692690{
693691 if (m_error)
694692 {
@@ -726,11 +724,11 @@ MCScriptExecuteContext::PushFrame(MCScriptInstanceRef p_instance,
726724 p_handler_def);
727725
728726 // Check the parameter count.
729- if (MCHandlerTypeInfoGetParameterCount (t_signature) != p_argument_count )
727+ if (MCHandlerTypeInfoGetParameterCount (t_signature) != p_argument_regs. size () )
730728 {
731729 ThrowWrongNumberOfArguments (p_instance,
732730 p_handler_def,
733- p_argument_count );
731+ p_argument_regs. size () );
734732 return ;
735733 }
736734
@@ -802,16 +800,16 @@ MCScriptExecuteContext::PushFrame(MCScriptInstanceRef p_instance,
802800 // caller registers that were passed so we can copy back at the end.
803801 if (t_needs_mapping)
804802 {
805- if (!MCMemoryNewArray (p_argument_count ,
803+ if (!MCMemoryNewArray (p_argument_regs. size () ,
806804 t_new_frame->mapping ))
807805 {
808806 Rethrow ();
809807 return ;
810808 }
811809
812810 MCMemoryCopy (t_new_frame->mapping ,
813- p_argument_regs,
814- p_argument_count * sizeof ( p_argument_regs[ 0 ] ));
811+ p_argument_regs. data () ,
812+ p_argument_regs. sizeBytes ( ));
815813 }
816814
817815 // Finally, make the new frame the current frame and set the
0 commit comments