mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
8346888: [ubsan] block.cpp:1617:30: runtime error: 9.97582e+36 is outside the range of representable values of type 'int'
Reviewed-by: kvn, dlong
This commit is contained in:
@@ -1613,7 +1613,8 @@ void PhaseBlockLayout::find_edges() {
|
||||
Block *target = b->non_connector_successor(j);
|
||||
float freq = b->_freq * b->succ_prob(j);
|
||||
int from_pct = (int) ((100 * freq) / b->_freq);
|
||||
int to_pct = (int) ((100 * freq) / target->_freq);
|
||||
float f_to_pct = (100 * freq) / target->_freq;
|
||||
int to_pct = (f_to_pct < 100.0) ? (int)f_to_pct : 100;
|
||||
edges->append(new CFGEdge(b, target, freq, from_pct, to_pct));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user