(func, memtype_size)
| 112 | } |
| 113 | |
| 114 | function VerifyBoundsCheck64(func, memtype_size) { |
| 115 | const kPageSize = 65536; |
| 116 | // Test out of bounds at boundary |
| 117 | for (let i = memory.buffer.byteLength - memtype_size + 1; |
| 118 | i < memory.buffer.byteLength + memtype_size + 4; i++) { |
| 119 | assertTrapsOneOf( |
| 120 | // If an underlying platform uses traps for a bounds check, |
| 121 | // kTrapUnalignedAccess will be thrown before kTrapMemOutOfBounds. |
| 122 | // Otherwise, kTrapMemOutOfBounds will be first. |
| 123 | [kTrapMemOutOfBounds, kTrapUnalignedAccess], |
| 124 | () => func(i, 5n, 10n) |
| 125 | ); |
| 126 | } |
| 127 | // Test out of bounds at maximum + 1 |
| 128 | assertTraps(kTrapMemOutOfBounds, () => func((maxSize + 1) * kPageSize, 5n, 1n)); |
| 129 | } |
| 130 | |
| 131 | function VerifyBoundsCheck(func, memtype_size) { |
| 132 | const kPageSize = 65536; |
no test coverage detected