Use new druntime hooks _d_arraybounds_{slice,index} for more informative RangeErrors

Fixing dmd-testsuite's runnable/testbounds.d.
This commit is contained in:
Martin Kinkelin 2021-09-09 17:30:33 +02:00
parent 64d79ef753
commit fab82436dd
6 changed files with 75 additions and 28 deletions

View file

@ -559,6 +559,17 @@ static void buildRuntimeModule() {
createFwdDecl(LINK::c, voidTy, {"_d_assert_msg"}, {stringTy, stringTy, uintTy},
{}, Attr_Cold_NoReturn);
// void _d_arraybounds_slice(string file, uint line, size_t lower,
// size_t upper, size_t length)
createFwdDecl(LINK::c, voidTy, {"_d_arraybounds_slice"},
{stringTy, uintTy, sizeTy, sizeTy, sizeTy}, {},
Attr_Cold_NoReturn);
// void _d_arraybounds_index(string file, uint line, size_t index,
// size_t length)
createFwdDecl(LINK::c, voidTy, {"_d_arraybounds_index"},
{stringTy, uintTy, sizeTy, sizeTy}, {}, Attr_Cold_NoReturn);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////