Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
integer-range-bug-investigation
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Kia
integer-range-bug-investigation
Commits
7546e24c
Commit
7546e24c
authored
3 years ago
by
Kia
Browse files
Options
Downloads
Patches
Plain Diff
print the byte index along with the character set
parent
a921e688
Branches
master
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gen_intrange.c
+13
-7
13 additions, 7 deletions
gen_intrange.c
with
13 additions
and
7 deletions
gen_intrange.c
+
13
−
7
View file @
7546e24c
...
@@ -28,7 +28,7 @@ struct charset * new_charset(void) {
...
@@ -28,7 +28,7 @@ struct charset * new_charset(void) {
}
}
void
print_charset
(
struct
charset
*
cs
,
int
depth
)
{
void
print_charset
(
struct
charset
*
cs
,
int
depth
)
{
printf
(
"current byte index = %d "
,
depth
);
printf
(
"current byte index = %d
\n
"
,
depth
);
for
(
int
i
=
0
;
i
<
32
;
i
++
)
for
(
int
i
=
0
;
i
<
32
;
i
++
)
{
{
printf
(
"%hhx "
,
cs
->
bitmap
[
i
]);
printf
(
"%hhx "
,
cs
->
bitmap
[
i
]);
...
@@ -103,8 +103,9 @@ void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_
...
@@ -103,8 +103,9 @@ void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_
charset_set
(
cs
,
i
,
1
);
charset_set
(
cs
,
i
,
1
);
}
}
printf
(
"current byte index = %d "
,
current_byte_index
);
printf
(
"current byte index = %d "
,
current_byte_index
);
print_charset
(
cs
,
current_byte_index
);
current_byte_index
++
;
current_byte_index
++
;
print_charset
(
cs
);
}
}
else
if
(
1
<
bytes
)
{
else
if
(
1
<
bytes
)
{
uint8_t
low_head
,
hi_head
;
uint8_t
low_head
,
hi_head
;
...
@@ -119,9 +120,10 @@ void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_
...
@@ -119,9 +120,10 @@ void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_
current_byte_index
=
starting_byte_index
;
current_byte_index
=
starting_byte_index
;
{
{
printf
(
"current byte index = %d "
,
current_byte_index
);
printf
(
"current byte index = %d "
,
current_byte_index
);
HCFS_ADD_CHAR
(
low_head
,
current_byte_index
);
current_byte_index
++
;
current_byte_index
++
;
HCFS_ADD_CHAR
(
low_head
);
gen_int_range
(
low
&
((
1
<<
(
8
*
(
bytes
-
1
)))
-
1
),
((
1
<<
(
8
*
(
bytes
-
1
)))
-
1
),
bytes
-
1
,
current_byte_index
);
gen_int_range
(
low
&
((
1
<<
(
8
*
(
bytes
-
1
)))
-
1
),
((
1
<<
(
8
*
(
bytes
-
1
)))
-
1
),
bytes
-
1
,
current_byte_index
);
}
}
HCFS_END_SEQ
();
HCFS_END_SEQ
();
...
@@ -137,14 +139,16 @@ void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_
...
@@ -137,14 +139,16 @@ void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_
charset_set
(
rest
,
i
,
1
);
charset_set
(
rest
,
i
,
1
);
}
}
printf
(
"current byte index = %d "
,
current_byte_index
);
printf
(
"current byte index = %d "
,
current_byte_index
);
HCFS_ADD_CHARSET
(
hd
,
current_byte_index
);
current_byte_index
++
;
current_byte_index
++
;
HCFS_ADD_CHARSET
(
hd
);
for
(
int
i
=
2
;
i
<=
bytes
;
i
++
)
{
for
(
int
i
=
2
;
i
<=
bytes
;
i
++
)
{
printf
(
"current byte index = %d "
,
current_byte_index
);
printf
(
"current byte index = %d "
,
current_byte_index
);
HCFS_ADD_CHARSET
(
rest
,
current_byte_index
);
current_byte_index
++
;
current_byte_index
++
;
HCFS_ADD_CHARSET
(
rest
);
}
}
}
}
HCFS_END_SEQ
();
HCFS_END_SEQ
();
...
@@ -153,9 +157,10 @@ void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_
...
@@ -153,9 +157,10 @@ void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_
{
{
current_byte_index
=
starting_byte_index
;
current_byte_index
=
starting_byte_index
;
printf
(
"current byte index = %d "
,
current_byte_index
);
printf
(
"current byte index = %d "
,
current_byte_index
);
HCFS_ADD_CHAR
(
hi_head
,
current_byte_index
);
current_byte_index
++
;
current_byte_index
++
;
HCFS_ADD_CHAR
(
hi_head
);
gen_int_range
(
0
,
high
&
((
1
<<
(
8
*
(
bytes
-
1
)))
-
1
),
bytes
-
1
,
current_byte_index
);
gen_int_range
(
0
,
high
&
((
1
<<
(
8
*
(
bytes
-
1
)))
-
1
),
bytes
-
1
,
current_byte_index
);
}
}
HCFS_END_SEQ
();
HCFS_END_SEQ
();
...
@@ -171,9 +176,10 @@ void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_
...
@@ -171,9 +176,10 @@ void gen_int_range(uint64_t low, uint64_t high, uint8_t bytes, uint8_t starting_
current_byte_index
=
starting_byte_index
;
current_byte_index
=
starting_byte_index
;
printf
(
"current byte index = %d "
,
current_byte_index
);
printf
(
"current byte index = %d "
,
current_byte_index
);
HCFS_ADD_CHAR
(
low_head
,
current_byte_index
);
current_byte_index
++
;
current_byte_index
++
;
HCFS_ADD_CHAR
(
low_head
);
gen_int_range
(
gen_int_range
(
low
&
((
1
<<
(
8
*
(
bytes
-
1
)))
-
1
),
low
&
((
1
<<
(
8
*
(
bytes
-
1
)))
-
1
),
high
&
((
1
<<
(
8
*
(
bytes
-
1
)))
-
1
),
high
&
((
1
<<
(
8
*
(
bytes
-
1
)))
-
1
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment