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

Method ReadSLEB128

IDEHelper/Compiler/BfIRCodeGen.cpp:910–925  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

908}
909
910int64 BfIRCodeGen::ReadSLEB128()
911{
912 int64 val = 0;
913 int64 shift = 0;
914 uint8 byteVal;
915 do
916 {
917 byteVal = mStream->Read();
918 val |= ((int64)(byteVal & 0x7f)) << shift;
919 shift += 7;
920 } while (byteVal >= 128);
921 // Sign extend negative numbers.
922 if ((byteVal & 0x40) && (shift < 64))
923 val |= (-1ULL) << shift;
924 return val;
925}
926
927void BfIRCodeGen::Read(StringImpl& str)
928{

Callers

nothing calls this directly

Calls 1

ReadMethod · 0.45

Tested by

no test coverage detected