Fix JavaScript bounds checking
Fixes #23123 (closed)
This MR fixes JavaScript bounds checking for the -fcheck-prim-bounds
flag with byte arrays by:
- checking for the
len
field that is used to track byte array lengths, rather than the built-in JavaScriptlength
field that is used by regular arrays - checking for range operations that use a size-zero range (effectively no-ops)
Additionally, the js_broken(23123)
("JS bounds checking broken") for the CheckBoundsOK
test introduced in !9629 (closed) is changed to js_broken(21142)
("RuntimeRep requirements for novel Backends"), since the test is still failing on Addr
representation.
Merge request reports
Activity
added 100 commits
-
fe03d242...cd00e321 - 99 commits from branch
master
- 75ea4767 - JS: fix bounds checking
-
fe03d242...cd00e321 - 99 commits from branch
added javascript label
This doesn't look finished because there are 7 failing tests still:
Unexpected failures: /builds/ghc/ghc/tmp/ghctest-pg8kapvo/test spaces/testsuite/tests/codeGen/should_fail/CheckBoundsCompareByteArray2.run CheckBoundsCompareByteArray2 [bad exit code (0)] (normal) /builds/ghc/ghc/tmp/ghctest-pg8kapvo/test spaces/testsuite/tests/codeGen/should_fail/CheckBoundsCompareByteArray3.run CheckBoundsCompareByteArray3 [bad exit code (0)] (normal) /builds/ghc/ghc/tmp/ghctest-pg8kapvo/test spaces/testsuite/tests/codeGen/should_fail/CheckBoundsReadInt64Array.run CheckBoundsReadInt64Array [bad exit code (0)] (normal) /builds/ghc/ghc/tmp/ghctest-pg8kapvo/test spaces/testsuite/tests/codeGen/should_fail/CheckBoundsReadWord64Array.run CheckBoundsReadWord64Array [bad exit code (0)] (normal) /builds/ghc/ghc/tmp/ghctest-pg8kapvo/test spaces/testsuite/tests/codeGen/should_fail/CheckBoundsReadWord8ArrayAsWord32.run CheckBoundsReadWord8ArrayAsWord32 [bad exit code (1)] (normal) /builds/ghc/ghc/tmp/ghctest-pg8kapvo/test spaces/testsuite/tests/codeGen/should_fail/CheckOverlapCopyAddrToByteArray.run CheckOverlapCopyAddrToByteArray [bad exit code (0)] (normal) /builds/ghc/ghc/tmp/ghctest-pg8kapvo/test spaces/testsuite/tests/codeGen/should_fail/CheckOverlapCopyByteArray.run CheckOverlapCopyByteArray [bad exit code (0)] (normal)
marking as draft.
Can you also add more description to the commit message and make sure the ticket number is also in the commit message?
requested review from @doyougnu
- Resolved by Josh Meredith
229 229 test('T22296',[only_ways(llvm_ways) 230 230 ,unless(arch('x86_64'), skip)],compile_and_run,['']) 231 231 test('T22798', normal, compile_and_run, ['-fregs-graph']) 232 test('CheckBoundsOK', js_broken(23123), compile_and_run, ['-fcheck-prim-bounds']) 232 test('CheckBoundsOK', js_broken(21142), compile_and_run, ['-fcheck-prim-bounds']) Un-resolving.
If you want to re-structure the test, fine. But leaving the entire test marked broken is pretty bad as there is no other test that tries to detect false positives.
In fact, there is still at least one false-positive bug in this patch that the non-
Addr#
bits of this test would detect if the failure wasn't being hidden.changed this line in version 10 of the diff
added 13 commits
-
db5327f0...3ba77b36 - 12 commits from branch
master
- fd18dfce - JS: fix bounds checking (Issue 23123)
-
db5327f0...3ba77b36 - 12 commits from branch
- Resolved by Josh Meredith
- Resolved by Josh Meredith
added 1 commit
- 53fbf777 - Revert bounds checking end index for JavaScript IndexByteArrayOp_Word8As*...
added 32 commits
-
53fbf777...df1a5811 - 31 commits from branch
master
- 01eb5675 - JS: fix bounds checking (Issue 23123)
-
53fbf777...df1a5811 - 31 commits from branch
requested review from @hsyl20
- Resolved by Josh Meredith