VirtualBox

Changeset 102859 in vbox


Ignore:
Timestamp:
Jan 12, 2024 2:09:30 PM (13 months ago)
Author:
vboxsync
Message:

PGM: Relaxed needle size assertions to match actual usage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PGMDbg.cpp

    r100965 r102859  
    454454                                                                    uint8_t const *pbNeedle, size_t cbNeedle)
    455455{
    456     Assert(cbNeedle == 8); RT_NOREF(cbNeedle);
     456    Assert(cbNeedle >= 8); RT_NOREF(cbNeedle);
    457457    const uint64_t uNeedle = *(const uint64_t *)pbNeedle;
    458458    uint64_t const *puHaystack = (uint64_t const *)pbHaystack;
     
    470470                                                                    uint8_t const *pbNeedle, size_t cbNeedle)
    471471{
    472     Assert(cbNeedle == 4); RT_NOREF(cbNeedle);
     472    Assert(cbNeedle >= 4); RT_NOREF(cbNeedle);
    473473    const uint32_t uNeedle = *(const uint32_t *)pbNeedle;
    474474    uint32_t const *puHaystack = (uint32_t const *)pbHaystack;
     
    486486                                                                    uint8_t const *pbNeedle, size_t cbNeedle)
    487487{
    488     Assert(cbNeedle == 2); RT_NOREF(cbNeedle);
     488    Assert(cbNeedle >= 2); RT_NOREF(cbNeedle);
    489489    const uint16_t uNeedle = *(const uint16_t *)pbNeedle;
    490490    uint16_t const *puHaystack = (uint16_t const *)pbHaystack;
     
    501501                                                                    uint8_t const *pbNeedle, size_t cbNeedle)
    502502{
    503     Assert(cbNeedle == 1); RT_NOREF(cbNeedle);
     503    Assert(cbNeedle >= 1); RT_NOREF(cbNeedle);
    504504    const uint8_t bNeedle = *pbNeedle;
    505505    while (cbHaystack-- > 0)
     
    515515                                                                    uint8_t const *pbNeedle, size_t cbNeedle)
    516516{
    517     Assert(cbNeedle == 4); RT_NOREF(cbNeedle);
     517    Assert(cbNeedle >= 4); RT_NOREF(cbNeedle);
    518518    uint32_t const uNeedle = *(uint32_t const *)pbNeedle;
    519519    while (cbHaystack >= sizeof(uint32_t))
     
    539539                                                                    uint8_t const *pbNeedle, size_t cbNeedle)
    540540{
    541     Assert(cbNeedle == 8); RT_NOREF(cbNeedle);
     541    Assert(cbNeedle >= 8); RT_NOREF(cbNeedle);
    542542    uint64_t const uNeedle = *(uint64_t const *)pbNeedle;
    543543    while (cbHaystack >= sizeof(uint64_t))
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette