Skip to content

Commit 64fb90d

Browse files
committed
consted the buffer pointer for the LEB128 handlers
1 parent b8a363a commit 64fb90d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/parser/file/dwarf/leb128.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323

2424
#include "leb128.h"
2525

26-
uint64_t getULEB128(void* begin, size_t* counter) {
26+
uint64_t getULEB128(const void* begin, size_t* counter) {
2727
uint64_t result = 0,
2828
shift = 0;
2929

3030
bool more = true;
3131
do {
32-
uint8_t b = *((uint8_t*) (begin + *counter));
32+
uint8_t b = *((const uint8_t*) (begin + *counter));
3333
*counter += 1;
3434
result |= (b & 0x7f) << shift;
3535
shift += 7;
@@ -40,13 +40,13 @@ uint64_t getULEB128(void* begin, size_t* counter) {
4040
return result;
4141
}
4242

43-
int64_t getLEB128(void* begin, size_t* counter) {
43+
int64_t getLEB128(const void* begin, size_t* counter) {
4444
int64_t result = 0,
4545
shift = 0;
4646

4747
bool more = true;
4848
do {
49-
uint8_t b = *((uint8_t*) (begin + *counter));
49+
uint8_t b = *((const uint8_t*) (begin + *counter));
5050
*counter += 1;
5151
result |= (b & 0x7f) << shift;
5252
shift += 7;

src/parser/file/dwarf/leb128.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* @param counter the memory position
3535
* @return the deducted number
3636
*/
37-
uint64_t getULEB128(void* begin, size_t* counter);
37+
uint64_t getULEB128(const void* begin, size_t* counter);
3838

3939
/**
4040
* @brief Reads a signed LEB128 integer from the given memory at the given position.
@@ -45,7 +45,7 @@ uint64_t getULEB128(void* begin, size_t* counter);
4545
* @param counter the memory position
4646
* @return the deducted number
4747
*/
48-
int64_t getLEB128(void* begin, size_t* counter);
48+
int64_t getLEB128(const void* begin, size_t* counter);
4949

5050

5151

0 commit comments

Comments
 (0)