Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cwe_checker
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
cwe_checker
Commits
9f0bc45b
Unverified
Commit
9f0bc45b
authored
Sep 03, 2020
by
Melvin Klimke
Committed by
GitHub
Sep 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a bug in the objdump output parsing in symbol_utils.ml (#83)
parent
52804195
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
20 deletions
+6
-20
symbol_utils.ml
src/utils/symbol_utils.ml
+6
-20
No files found.
src/utils/symbol_utils.ml
View file @
9f0bc45b
...
...
@@ -36,26 +36,12 @@ let call_finder_run = ref false
(** Parse a line from the dyn-syms output table of objdump. Return the name of a symbol if the symbol is an extern function name. *)
let
parse_dyn_sym_line
(
line
:
string
)
:
string
option
=
let
line
=
ref
(
String
.
strip
line
)
in
let
str_list
=
ref
[]
in
while
Option
.
is_some
(
String
.
rsplit2
!
line
~
on
:
'
'
)
do
let
(
left
,
right
)
=
Option
.
value_exn
(
String
.
rsplit2
!
line
~
on
:
'
'
)
in
line
:=
String
.
strip
left
;
str_list
:=
right
::
!
str_list
;
done
;
str_list
:=
!
line
::
!
str_list
;
match
!
str_list
with
|
value
::
func1
::
func2
::
_
->
begin
match
(
String
.
strip
~
drop
:
(
fun
x
->
x
=
'
0
'
)
value
)
with
|
""
->
begin
if
(
String
.
equal
func1
"DF"
||
String
.
equal
func2
"DF"
)
then
(
List
.
last
!
str_list
)
else
None
end
|
_
->
None
(* The symbol has a nonzero value, so we assume that it is not an extern function symbol. *)
end
|
_
->
None
let
columns
=
String
.
split_on_chars
~
on
:
[
'
'
;
'\t'
;
'\n'
;
'\r'
]
line
|>
List
.
filter
~
f
:
(
fun
x
->
x
<>
""
)
in
(* Check whether the symbol is a function --> DF and if it is referenced in the file, but defined outside it --> *UND* *)
match
((
Stdlib
.
List
.
mem
"DF"
columns
)
&&
(
Stdlib
.
List
.
mem
"*UND*"
columns
))
with
|
true
->
List
.
last
columns
|
false
->
None
let
parse_dyn_syms
(
project
:
Project
.
t
)
:
String
.
Set
.
t
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment