Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Toolchain
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
Zipr Toolchain
Commits
e5c21393
Commit
e5c21393
authored
6 years ago
by
Matthew McGill
Browse files
Options
Downloads
Patches
Plain Diff
Made constructor with slot size clearer
Former-commit-id: 67c0a0c54ed8adaae295b8d815a7476473d19ffa
parent
c82da996
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/selective_cfi/color_map.hpp
+10
-1
10 additions, 1 deletion
tools/selective_cfi/color_map.hpp
with
10 additions
and
1 deletion
tools/selective_cfi/color_map.hpp
+
10
−
1
View file @
e5c21393
...
...
@@ -77,7 +77,7 @@ class ColoredInstructionNonces_t
:
firp
(
the_firp
),
slot_size
(
1
),
slot_values
(
255
)
{
}
ColoredInstructionNonces_t
(
libIRDB
::
FileIR_t
*
the_firp
,
int
the_slot_size
)
:
firp
(
the_firp
),
slot_size
(
the_slot_size
),
slot_values
(
~
((
NonceVal
ueType_t
)
0
)
>>
(
sizeof
(
NonceValueType_t
)
*
8
-
the_slot_size
*
8
))
{
}
slot_values
(
Max
NonceVal
ForSlotSize
(
the_slot_size
))
{
}
ColoredSlotValues_t
GetColorsOfIBT
(
libIRDB
::
Instruction_t
*
i
)
{
return
color_assignments
[
i
];
}
...
...
@@ -112,6 +112,15 @@ class ColoredInstructionNonces_t
// the slot that each IB uses. ICFS_t -> slot_value
std
::
map
<
libIRDB
::
ICFS_t
,
ColoredSlotValue_t
>
slot_assignments
;
NonceValueType_t
MaxNonceValForSlotSize
(
int
slot_size
)
{
NonceValueType_t
max_nonce_val
=
~
((
NonceValueType_t
)
0
);
size_t
max_nonce_size_bits
=
sizeof
(
NonceValueType_t
)
*
8
;
size_t
slot_size_bits
=
slot_size
*
8
;
return
max_nonce_val
>>
(
max_nonce_size_bits
-
slot_size_bits
);
}
};
...
...
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