MCPcopy Create free account
hub / github.com/beefytech/Beef / ReadSLEB128

Method ReadSLEB128

IDEHelper/Backend/BeIRCodeGen.cpp:570–585  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

568}
569
570int64 BeIRCodeGen::ReadSLEB128()
571{
572 int64 val = 0;
573 int64 shift = 0;
574 uint8 byteVal;
575 do
576 {
577 byteVal = mStream->Read();
578 val |= ((int64)(byteVal & 0x7f)) << shift;
579 shift += 7;
580 } while (byteVal >= 128);
581 // Sign extend negative numbers.
582 if ((byteVal & 0x40) && (shift < 64))
583 val |= (-1ULL) << shift;
584 return val;
585}
586
587void BeIRCodeGen::Read(StringImpl& str)
588{

Callers

nothing calls this directly

Calls 1

ReadMethod · 0.45

Tested by

no test coverage detected