mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
GP-4871 Don't ignore signed to unsigned integer casts for
FLOAT_INT2FLOAT
This commit is contained in:
parent
a4d97ff872
commit
e5969a613c
16 changed files with 408 additions and 16 deletions
|
@ -5,9 +5,9 @@
|
|||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
@ -814,6 +814,37 @@ FlowBlock *FlowBlock::findCommonBlock(const vector<FlowBlock *> &blockSet)
|
|||
return res;
|
||||
}
|
||||
|
||||
/// \brief Find conditional block that decides between the given control-flow edges
|
||||
///
|
||||
/// There must be a unique path from the conditional block through the first edge, and
|
||||
/// a second unique path through the second edge. Otherwise null is returned. The index of the
|
||||
/// output block from the conditional that flows to the first edge is passed back.
|
||||
/// \param bl1 is the destination block for the first given control-flow edge
|
||||
/// \param edge1 is the input slot for the first edge
|
||||
/// \param bl2 is the destination block for the second given control-flow edge
|
||||
/// \param edge2 is the input slot for the second edge
|
||||
/// \param slot1 will hold the output slot leading to the first control-flow edge
|
||||
/// \return the conditional FlowBlock if it exists or null
|
||||
FlowBlock *FlowBlock::findCondition(FlowBlock *bl1,int4 edge1,FlowBlock *bl2,int4 edge2,int4 &slot1)
|
||||
|
||||
{
|
||||
FlowBlock *cond = bl1->getIn(edge1);
|
||||
while (cond->sizeOut() != 2) {
|
||||
if (cond->sizeOut() != 1) return (FlowBlock *)0;
|
||||
bl1 = cond;
|
||||
edge1 = 0;
|
||||
cond = bl1->getIn(0);
|
||||
}
|
||||
|
||||
while (cond != bl2->getIn(edge2)) {
|
||||
bl2 = bl2->getIn(edge2);
|
||||
if (bl2->sizeOut() != 1) return (FlowBlock *)0;
|
||||
edge2 = 0;
|
||||
}
|
||||
slot1 = bl1->getInRevIndex(edge1);
|
||||
return cond;
|
||||
}
|
||||
|
||||
/// Add the given FlowBlock to the list and make \b this the parent
|
||||
/// Update \b index so that it has the minimum over all components
|
||||
/// \param bl is the given FlowBlock
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue