repo.or.cz
/
haiku.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
vfs: check userland buffers before reading them.
[haiku.git]
/
src
/
libs
/
libunwind
/
mi
/
_ReadULEB.c
blob
116f3e19bc9503a4ac9e4f1faad7752f39838d86
1
#include <libunwind.h>
2
3
unw_word_t
4
_ReadULEB
(
unsigned char
**
dpp
)
5
{
6
unsigned
shift
=
0
;
7
unw_word_t byte
,
result
=
0
;
8
unsigned char
*
bp
= *
dpp
;
9
10
while
(
1
)
11
{
12
byte
= *
bp
++;
13
result
|= (
byte
&
0x7f
) <<
shift
;
14
if
((
byte
&
0x80
) ==
0
)
15
break
;
16
shift
+=
7
;
17
}
18
*
dpp
=
bp
;
19
return
result
;
20
}