MCPcopy Create free account
hub / github.com/ZDoom/Raze / WriteAdvanceLoc

Function WriteAdvanceLoc

source/common/scripting/jit/jit_runtime.cpp:446–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444}
445
446static void WriteAdvanceLoc(TArray<uint8_t> &fdeInstructions, uint64_t offset, uint64_t &lastOffset)
447{
448 uint64_t delta = offset - lastOffset;
449 if (delta < (1 << 6))
450 {
451 WriteUInt8(fdeInstructions, (1 << 6) | delta); // DW_CFA_advance_loc
452 }
453 else if (delta < (1 << 8))
454 {
455 WriteUInt8(fdeInstructions, 2); // DW_CFA_advance_loc1
456 WriteUInt8(fdeInstructions, delta);
457 }
458 else if (delta < (1 << 16))
459 {
460 WriteUInt8(fdeInstructions, 3); // DW_CFA_advance_loc2
461 WriteUInt16(fdeInstructions, delta);
462 }
463 else
464 {
465 WriteUInt8(fdeInstructions, 4); // DW_CFA_advance_loc3
466 WriteUInt32(fdeInstructions, delta);
467 }
468 lastOffset = offset;
469}
470
471static void WriteDefineCFA(TArray<uint8_t> &cieInstructions, int dwarfRegId, int stackOffset)
472{

Callers 1

CreateUnwindInfoUnixFunction · 0.85

Calls 3

WriteUInt8Function · 0.85
WriteUInt16Function · 0.85
WriteUInt32Function · 0.85

Tested by

no test coverage detected