File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -466,10 +466,7 @@ struct MCScriptBytecodeOp_InvokeIndirect
466466 t_result_reg = ctxt.GetArgument (1 );
467467
468468 // The argument list starts at the third argument.
469- const uindex_t *t_argument_regs;
470- uindex_t t_argument_count;
471- t_argument_regs = ctxt.GetArgumentList () + 2 ;
472- t_argument_count = ctxt.GetArgumentCount () - 2 ;
469+ MCSpan<const uindex_t > t_argument_regs (ctxt.GetArguments ().subspan (2 ));
473470
474471 MCValueRef t_handler;
475472 t_handler = ctxt.CheckedFetchRegister (ctxt.GetArgument (0 ));
@@ -484,8 +481,8 @@ struct MCScriptBytecodeOp_InvokeIndirect
484481
485482#ifdef DEBUG_EXECUTION
486483 MCLog (" Invoke handler value %p from register %u into %u" , t_handler, t_result_reg);
487- for (uindex_t i = 0 ; i < t_argument_count; i++ )
488- MCLog (" argument register %u" , t_argument_regs[i] );
484+ for (MCSpan< const uindex_t > t_rest = t_argument_regs; !t_rest. empty (); ++t_rest )
485+ MCLog (" argument register %u" , *t_rest );
489486#endif
490487
491488 // If the handler-ref is of 'internal' kind (i.e. a instance/definition
@@ -497,14 +494,14 @@ struct MCScriptBytecodeOp_InvokeIndirect
497494 InternalInvoke (ctxt,
498495 (MCHandlerRef)t_handler,
499496 t_result_reg,
500- MCMakeSpan ( t_argument_regs, t_argument_count) );
497+ t_argument_regs);
501498 }
502499 else
503500 {
504501 ExternalInvoke (ctxt,
505502 (MCHandlerRef)t_handler,
506503 t_result_reg,
507- MCMakeSpan ( t_argument_regs, t_argument_count) );
504+ t_argument_regs);
508505 }
509506 }
510507
You can’t perform that action at this time.
0 commit comments