(input io.ByteReader)
| 462 | } |
| 463 | |
| 464 | func decodeLEB128ByteReader(input io.ByteReader) (uint, error) { |
| 465 | var num, sz uint |
| 466 | for { |
| 467 | if sz*7 > uintBits-7 { |
| 468 | return 0, ErrLengthOverflow |
| 469 | } |
| 470 | |
| 471 | b, err := input.ReadByte() |
| 472 | if err != nil { |
| 473 | return 0, err |
| 474 | } |
| 475 | |
| 476 | num |= (uint(b) & payload) << (sz * 7) // concats 7 bits chunks |
| 477 | sz++ |
| 478 | |
| 479 | if uint(b)&continuation == 0 { |
| 480 | break |
| 481 | } |
| 482 | } |
| 483 | |
| 484 | return num, nil |
| 485 | } |
| 486 | |
| 487 | func isCopyFromSrc(cmd byte) bool { |
| 488 | return (cmd & continuation) != 0 |
searching dependent graphs…