MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / fixLoop

Method fixLoop

Engine/source/console/compiler.cpp:469–503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

467//-------------------------------------------------------------------------
468
469void CodeStream::fixLoop(U32 loopBlockStart, U32 breakPoint, U32 continuePoint)
470{
471 AssertFatal(mFixStack.size() > 0, "Fix stack mismatch");
472
473 U32 fixStart = mFixStack[mFixStack.size() - 1];
474 for (U32 i = fixStart; i<mFixList.size(); i += 2)
475 {
476 FixType type = (FixType)mFixList[i + 1];
477
478 U32 fixedIp = 0;
479 bool valid = true;
480
481 switch (type)
482 {
483 case FIXTYPE_LOOPBLOCKSTART:
484 fixedIp = loopBlockStart;
485 break;
486 case FIXTYPE_BREAK:
487 fixedIp = breakPoint;
488 break;
489 case FIXTYPE_CONTINUE:
490 fixedIp = continuePoint;
491 break;
492 default:
493 //Con::warnf("Address %u fixed as %u", mFixList[i], mFixList[i+1]);
494 valid = false;
495 break;
496 }
497
498 if (valid)
499 {
500 patch(mFixList[i], fixedIp);
501 }
502 }
503}
504
505//-------------------------------------------------------------------------
506

Callers 1

compileStmtMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected