Skip to content

Commit 8f4b781

Browse files
authored
[SYCL][libdevice] Fix uninitialized var usage in libdevice function (#7538)
1 parent 5c9e543 commit 8f4b781

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

libdevice/imf_half.hpp

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -367,13 +367,12 @@ static uint16_t __iml_integral2half_u(Ty u, __iml_rounding_mode rounding_mode) {
367367
break;
368368
}
369369
}
370-
}
371-
372-
if (h_mant == 0x400) {
373-
h_exp++;
374-
h_mant = 0;
375-
if (h_exp > 15)
376-
is_overflow = true;
370+
if (h_mant == 0x400) {
371+
h_exp++;
372+
h_mant = 0;
373+
if (h_exp > 15)
374+
is_overflow = true;
375+
}
377376
}
378377

379378
if (is_overflow) {
@@ -437,13 +436,12 @@ static uint16_t __iml_integral2half_s(Ty i, __iml_rounding_mode rounding_mode) {
437436
break;
438437
}
439438
}
440-
}
441-
442-
if (h_mant == 0x400) {
443-
h_exp++;
444-
h_mant = 0;
445-
if (h_exp > 15)
446-
is_overflow = true;
439+
if (h_mant == 0x400) {
440+
h_exp++;
441+
h_mant = 0;
442+
if (h_exp > 15)
443+
is_overflow = true;
444+
}
447445
}
448446

449447
if (is_overflow) {

0 commit comments

Comments
 (0)