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

Method fixLoop

Engine/source/console/compiler.cpp:319–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

317//-------------------------------------------------------------------------
318
319void CodeStream::fixLoop(U32 loopBlockStart, U32 breakPoint, U32 continuePoint)
320{
321 AssertFatal(mFixStack.size() > 0, "Fix stack mismatch");
322
323 U32 fixStart = mFixStack[mFixStack.size()-1];
324 for (U32 i=fixStart; i<mFixList.size(); i += 2)
325 {
326 FixType type = (FixType)mFixList[i+1];
327
328 U32 fixedIp = 0;
329 bool valid = true;
330
331 switch (type)
332 {
333 case FIXTYPE_LOOPBLOCKSTART:
334 fixedIp = loopBlockStart;
335 break;
336 case FIXTYPE_BREAK:
337 fixedIp = breakPoint;
338 break;
339 case FIXTYPE_CONTINUE:
340 fixedIp = continuePoint;
341 break;
342 default:
343 //Con::warnf("Address %u fixed as %u", mFixList[i], mFixList[i+1]);
344 valid = false;
345 break;
346 }
347
348 if (valid)
349 {
350 patch(mFixList[i], fixedIp);
351 }
352 }
353}
354
355//-------------------------------------------------------------------------
356

Callers 1

compileStmtMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected