| 1555 | |
| 1556 | #ifndef _KERNEL |
| 1557 | static void |
| 1558 | DeserializeNumberFloat(char *szLocation, char *pBuffer, size_t zBUfferLength, struct CTypeDescriptor *pType, unsigned long ulNumber) |
| 1559 | { |
| 1560 | size_t zNumberWidth; |
| 1561 | |
| 1562 | ASSERT(szLocation); |
| 1563 | ASSERT(pBuffer); |
| 1564 | ASSERT(zBUfferLength > 0); |
| 1565 | ASSERT(pType); |
| 1566 | ASSERT(pType->mTypeKind == KIND_FLOAT); |
| 1567 | |
| 1568 | zNumberWidth = zDeserializeTypeWidth(pType); |
| 1569 | switch (zNumberWidth) { |
| 1570 | default: |
| 1571 | Report(true, "UBSan: Unexpected %zu-Bit Type in %s\n", zNumberWidth, szLocation); |
| 1572 | /* NOTREACHED */ |
| 1573 | #ifdef __HAVE_LONG_DOUBLE |
| 1574 | case WIDTH_128: |
| 1575 | case WIDTH_96: |
| 1576 | case WIDTH_80: |
| 1577 | DeserializeFloatOverPointer(pBuffer, zBUfferLength, pType, REINTERPRET_CAST(unsigned long *, ulNumber)); |
| 1578 | break; |
| 1579 | #endif |
| 1580 | case WIDTH_64: |
| 1581 | if (sizeof(ulNumber) * CHAR_BIT < WIDTH_64) { |
| 1582 | DeserializeFloatOverPointer(pBuffer, zBUfferLength, pType, REINTERPRET_CAST(unsigned long *, ulNumber)); |
| 1583 | break; |
| 1584 | } |
| 1585 | case WIDTH_32: |
| 1586 | case WIDTH_16: |
| 1587 | DeserializeFloatInlined(pBuffer, zBUfferLength, pType, ulNumber); |
| 1588 | break; |
| 1589 | } |
| 1590 | } |
| 1591 | #endif |
| 1592 | |
| 1593 | static void |
no test coverage detected