Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libehp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
libehp
Compare revisions
48f159696950faf489d6a515a4c35823bffae67d to ddbd18c3263eaab5c194a8ff5da821f349f142b2
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
opensrc/libehp
Select target project
No results found
ddbd18c3263eaab5c194a8ff5da821f349f142b2
Select Git revision
Branches
add_arm32
aware-sw-delivery
master
ubuntu24
Tags
CFAR_AEI
Release_1.0.0
Swap
Target
opensrc/libehp
Select target project
opensrc/libehp
1 result
48f159696950faf489d6a515a4c35823bffae67d
Select Git revision
Branches
add_arm32
aware-sw-delivery
master
ubuntu24
Tags
CFAR_AEI
Release_1.0.0
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (5)
put assert->throw code back in.
· 7bc6d511
Jason Hiser
authored
5 years ago
7bc6d511
put assert->throw code back in.
· 8fb8dd48
Jason Hiser
authored
5 years ago
8fb8dd48
fixed overflow in reading action table offset
· 45b7436f
Jason Hiser
authored
5 years ago
45b7436f
fixed 2nd buffer overflow found by turbo
· acaace5a
Jason Hiser
authored
5 years ago
acaace5a
found bug where length of dwarf instruction was not bounds checked
· ddbd18c3
Jason Hiser
authored
5 years ago
ddbd18c3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
SConscript
+11
-12
11 additions, 12 deletions
SConscript
SConstruct
+3
-0
3 additions, 0 deletions
SConstruct
src/ehp.cpp
+24
-10
24 additions, 10 deletions
src/ehp.cpp
src/throw_assert.h
+2
-0
2 additions, 0 deletions
src/throw_assert.h
with
40 additions
and
22 deletions
SConscript
View file @
ddbd18c3
...
...
@@ -17,24 +17,23 @@
import
os
Import
(
'
env
'
)
myenv
=
env
.
Clone
();
my
env
.
Replace
(
debug
=
ARGUMENTS
.
get
(
"
debug
"
,
0
))
my
env
.
Append
(
CFLAGS
=
"
-DUSE_ELFIO=1
"
)
my
env
.
Append
(
CXXFLAGS
=
"
-DUSE_ELFIO=1
"
)
if
int
(
my
env
[
'
debug
'
])
==
1
:
env
.
Replace
(
debug
=
ARGUMENTS
.
get
(
"
debug
"
,
0
))
env
.
Append
(
CFLAGS
=
"
-DUSE_ELFIO=1
"
)
env
.
Append
(
CXXFLAGS
=
"
-DUSE_ELFIO=1
"
)
if
int
(
env
[
'
debug
'
])
==
1
:
print
"
Setting debug mode
"
my
env
.
Append
(
CFLAGS
=
"
-g
"
)
my
env
.
Append
(
CXXFLAGS
=
"
-g
"
)
my
env
.
Append
(
LINKFLAGS
=
"
-g
"
)
env
.
Append
(
CFLAGS
=
"
-g
"
)
env
.
Append
(
CXXFLAGS
=
"
-g
"
)
env
.
Append
(
LINKFLAGS
=
"
-g
"
)
else
:
print
"
Setting release mode
"
my
env
.
Append
(
CFLAGS
=
"
-O3
"
)
my
env
.
Append
(
CXXFLAGS
=
"
-O3
"
)
my
env
.
Append
(
LINKFLAGS
=
"
-O3
"
)
env
.
Append
(
CFLAGS
=
"
-O3
"
)
env
.
Append
(
CXXFLAGS
=
"
-O3
"
)
env
.
Append
(
LINKFLAGS
=
"
-O3
"
)
lib
=
my
env
.
SConscript
(
"
src/SConscript
"
)
lib
=
env
.
SConscript
(
"
src/SConscript
"
)
Return
(
'
lib
'
)
This diff is collapsed.
Click to expand it.
SConstruct
View file @
ddbd18c3
...
...
@@ -19,6 +19,9 @@
env
=
Environment
()
Export
(
'
env
'
)
env
.
Replace
(
debug
=
ARGUMENTS
.
get
(
"
debug
"
,
0
))
lib
=
SConscript
(
"
SConscript
"
)
Return
(
'
lib
'
)
This diff is collapsed.
Click to expand it.
src/ehp.cpp
View file @
ddbd18c3
...
...
@@ -243,10 +243,12 @@ bool eh_frame_util_t<ptrsize>::read_sleb128 (
auto
byte
=
uint8_t
(
0
);
do
{
if
(
position
>
max
)
return
true
;
byte
=
data
[
position
];
position
++
;
result
|=
((
byte
&
0x7f
)
<<
shift
);
shift
+=
7
;
position
++
;
}
while
(
(
byte
&
0x80
)
!=
0
);
/* sign bit of byte is second high order bit (0x40) */
...
...
@@ -442,7 +444,6 @@ void eh_program_insn_t<ptrsize>::print(uint64_t &pc, int64_t caf) const
if
(
eh_frame_util_t
<
ptrsize
>::
read_uleb128
(
uleb
,
pos
,
(
const
uint8_t
*
const
)
data
.
data
(),
max
))
return
;
cout
<<
" def_cfa_expression "
<<
dec
<<
uleb
<<
endl
;
pos
+=
uleb
;
// doing this old school for now, as we aren't printing the expression.
break
;
}
case
DW_CFA_expression
:
...
...
@@ -454,7 +455,6 @@ void eh_program_insn_t<ptrsize>::print(uint64_t &pc, int64_t caf) const
if
(
eh_frame_util_t
<
ptrsize
>::
read_uleb128
(
uleb2
,
pos
,
(
const
uint8_t
*
const
)
data
.
data
(),
max
))
return
;
cout
<<
" expression "
<<
dec
<<
uleb1
<<
" "
<<
uleb2
<<
endl
;
pos
+=
uleb2
;
break
;
}
case
DW_CFA_val_expression
:
...
...
@@ -466,7 +466,6 @@ void eh_program_insn_t<ptrsize>::print(uint64_t &pc, int64_t caf) const
if
(
eh_frame_util_t
<
ptrsize
>::
read_uleb128
(
uleb2
,
pos
,
(
const
uint8_t
*
const
)
data
.
data
(),
max
))
return
;
cout
<<
" val_expression "
<<
dec
<<
uleb1
<<
" "
<<
uleb2
<<
endl
;
pos
+=
uleb2
;
break
;
}
case
DW_CFA_def_cfa_offset_sf
:
...
...
@@ -753,18 +752,26 @@ bool eh_program_insn_t<ptrsize>::parse_insn(
case
DW_CFA_set_loc
:
pos
+=
ptrsize
;
if
(
pos
>
max
)
return
true
;
break
;
case
DW_CFA_advance_loc1
:
pos
+=
1
;
if
(
pos
>
max
)
return
true
;
break
;
case
DW_CFA_advance_loc2
:
pos
+=
2
;
if
(
pos
>
max
)
return
true
;
break
;
case
DW_CFA_advance_loc4
:
pos
+=
4
;
if
(
pos
>
max
)
return
true
;
break
;
case
DW_CFA_offset_extended
:
...
...
@@ -796,6 +803,10 @@ bool eh_program_insn_t<ptrsize>::parse_insn(
if
(
eh_frame_util_t
<
ptrsize
>::
read_uleb128
(
uleb
,
pos
,
data
,
max
))
return
true
;
pos
+=
uleb
;
if
(
pos
>
max
)
return
true
;
if
(
pos
>
max
)
return
true
;
break
;
}
case
DW_CFA_expression
:
...
...
@@ -808,6 +819,8 @@ bool eh_program_insn_t<ptrsize>::parse_insn(
if
(
eh_frame_util_t
<
ptrsize
>::
read_uleb128
(
uleb2
,
pos
,
data
,
max
))
return
true
;
pos
+=
uleb2
;
if
(
pos
>
max
)
return
true
;
break
;
}
case
DW_CFA_def_cfa_offset_sf
:
...
...
@@ -1382,23 +1395,24 @@ bool lsda_call_site_t<ptrsize>::parse_lcs(
const
uint8_t
cs_table_encoding
,
uint32_t
&
pos
,
const
uint8_t
*
const
data
,
const
uint64_t
max
,
/* call site table max */
const
uint64_t
cs_
max
,
/* call site table max */
const
uint64_t
data_addr
,
const
uint64_t
landing_pad_base_addr
,
const
uint64_t
gcc_except_table_max
)
{
const
auto
smallest_max
=
min
(
cs_max
,
gcc_except_table_max
);
call_site_addr_position
=
pos
+
data_addr
;
if
(
this
->
read_type_with_encoding
(
cs_table_encoding
,
call_site_offset
,
pos
,
data
,
max
,
data_addr
))
if
(
this
->
read_type_with_encoding
(
cs_table_encoding
,
call_site_offset
,
pos
,
data
,
smallest_
max
,
data_addr
))
return
true
;
call_site_addr
=
landing_pad_base_addr
+
call_site_offset
;
call_site_end_addr_position
=
pos
+
data_addr
;
if
(
this
->
read_type_with_encoding
(
cs_table_encoding
,
call_site_length
,
pos
,
data
,
max
,
data_addr
))
if
(
this
->
read_type_with_encoding
(
cs_table_encoding
,
call_site_length
,
pos
,
data
,
smallest_
max
,
data_addr
))
return
true
;
call_site_end_addr
=
call_site_addr
+
call_site_length
;
landing_pad_addr_position
=
pos
+
data_addr
;
if
(
this
->
read_type_with_encoding
(
cs_table_encoding
,
landing_pad_offset
,
pos
,
data
,
max
,
data_addr
))
if
(
this
->
read_type_with_encoding
(
cs_table_encoding
,
landing_pad_offset
,
pos
,
data
,
smallest_
max
,
data_addr
))
return
true
;
landing_pad_addr_end_position
=
pos
+
data_addr
;
...
...
@@ -1408,7 +1422,7 @@ bool lsda_call_site_t<ptrsize>::parse_lcs(
else
landing_pad_addr
=
landing_pad_base_addr
+
landing_pad_offset
;
if
(
this
->
read_uleb128
(
action
,
pos
,
data
,
max
))
if
(
this
->
read_uleb128
(
action
,
pos
,
data
,
smallest_
max
))
return
true
;
if
(
action
==
0
)
...
...
@@ -1424,7 +1438,7 @@ bool lsda_call_site_t<ptrsize>::parse_lcs(
while
(
!
end
)
{
lsda_call_site_action_t
<
ptrsize
>
lcsa
;
if
(
lcsa
.
parse_lcsa
(
act_table_pos
,
data
,
gcc_except_table
_max
,
end
))
if
(
lcsa
.
parse_lcsa
(
act_table_pos
,
data
,
smallest
_max
,
end
))
return
true
;
action_table
.
push_back
(
lcsa
);
...
...
This diff is collapsed.
Click to expand it.
src/throw_assert.h
View file @
ddbd18c3
#define use_throwing_assert
#ifndef throw_asssert
#ifdef use_throwing_assert
...
...
This diff is collapsed.
Click to expand it.