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

Function WriteFDE

source/common/scripting/jit/jit_runtime.cpp:426–444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

424}
425
426static void WriteFDE(TArray<uint8_t> &stream, const TArray<uint8_t> &fdeInstructions, uint32_t cieLocation, unsigned int &functionStart)
427{
428 unsigned int lengthPos = stream.Size();
429 WriteUInt32(stream, 0); // Length
430 uint32_t offsetToCIE = stream.Size() - cieLocation;
431 WriteUInt32(stream, offsetToCIE);
432
433 functionStart = stream.Size();
434 WriteUInt64(stream, 0); // func start
435 WriteUInt64(stream, 0); // func size
436
437 WriteULEB128(stream, 0); // LEB128 augmentation size
438
439 for (unsigned int i = 0; i < fdeInstructions.Size(); i++)
440 stream.Push(fdeInstructions[i]);
441
442 WritePadding(stream);
443 WriteLength(stream, lengthPos, stream.Size() - lengthPos - 4);
444}
445
446static void WriteAdvanceLoc(TArray<uint8_t> &fdeInstructions, uint64_t offset, uint64_t &lastOffset)
447{

Callers 1

CreateUnwindInfoUnixFunction · 0.85

Calls 7

WriteUInt32Function · 0.85
WriteUInt64Function · 0.85
WriteULEB128Function · 0.85
WritePaddingFunction · 0.85
WriteLengthFunction · 0.85
SizeMethod · 0.45
PushMethod · 0.45

Tested by

no test coverage detected